Republic of Ireland, Czech Republic and Croatia sealed their two-match playoff series earlier Tuesday and Ronaldo scored inside 8 minutes and again 8 minutes after halftime as Portugal held off 10-man Bosnia and Herzegovina.
The draw for next summer's tournament will be held Dec. 2.
Helder Postiga also scored twice, while Nani and Miguel Veloso also scored for Portugal, which had two two-goal leads closed to a one-goal deficit by Bosnia before three late goals at the Stadium of Light sealed Portugal's win.
The first game at Bosnia and Herzegovina finished 0-0, giving Portugal the win on aggregate, 6-2.
Zvjezdan Misimovic scored the first goal for Bosnia just before halftime, then after Ronaldo's second strike and the sending off of Senad Lulic, Emir Spahic scored as the visitors kept the pressure on Portugal.
But Postiga scored the first of his two goals in the 72nd, and followed Veloso with his second after 82 minutes, as Portugal secured its fifth straight berth in the Euro finals.
Republic of Ireland wrapped up its first Euro finals berth since 1988 and just the second in its history, as Stephen Ward scored in the opening half of a 1-1 tie with Estonia that sealed a 5-1 aggregate win.
Robbie Keane scored a brace in the first fixture in Estonia on Friday when the hosts had two players sent off, and the early goal from Ward was enough to put the Irish in control in the second leg at home.
Konstantin Vassiljev scored in the second half as Estonia, a surprise during qualifying, avoided being shutout in the two-legged series. Estonia has never advanced to the Euro finals.
In the other second matches, Petr Jiracek scored as Czech Republic advanced to its fifth straight Euro finals with a 1-0 victory over Montenegro that secured a 3-0 aggregate victory in their series.
Croatia held its three-goal cushion from the first game in Turkey, drawing the second match 0-0 for a 3-0 aggregate victory, and a third straight trip to the Euro finals.