The other last-four tie sees Juventus - in their first semi-final since 2003, face Carlo Ancelotti's Real Madrid, the defending champions.
The first legs will be played on 5 and 6 May, with the return matches a week later.
In the Europa League, holders Sevilla face Fiorentina, while Rafael Benitez's Napoli are up against Ukraine's Dnipro.
Bayern boss Guardiola won 13 trophies as a manager—including the Champions League in 2009 and 2011 - during four years at Barcelona.
He has reached the Champions League semi-finals in each of his six seasons as a manager, four with Barca and now two with Bayern.
Ancelotti will also be reunited with one of his former clubs, with the Italian having managed the Turin side from 1999 to 2001.
The draw leaves open the possibility of a Barcelona v Real Madrid European Cup final, something which has never happened before. The arch-rivals are also battling it out for the Spanish league title this season.
Real Madrid reached the last four by beating city rivals Atletico - in a repeat of last season's final—thanks to Javier Hernandez's late goal.
Bayern Munich thrashed Porto 6-1 at home to overturn a first-leg deficit and progress 7-4 on aggregate.
Things were more straightforward for Barcelona, who beat Paris St-Germain 5-1 overall, and Juventus, who beat Monaco 1-0 over two legs.
This season's final will be played at Berlin's Olympic Stadium on Saturday, 6 June.
The Europa League draw leaves the possibility of an all-Serie A final. There have been four all-Italian Uefa Cup finals, but none since the tournament was rebranded in 2009.
The first legs of the semi-finals will be played on Thursday, 7 May with the return matches a week later.
The final is in Warsaw's National Stadium on Wednesday, 27 May.