The winner of those two ties will face each other in the semifinals, which were also drawn on Friday in Nyon, Switzerland.
Madrid knocked out Chelsea in last year’s quarterfinal in dramatic fashion amid a spirited second-leg comeback from the Premier League club.
Speaking at a fan event on Thursday, Chelsea boss Graham Potter said his team are aiming to win the “f—ing Champions League.”
Following Friday’s draw, Potter told a news conference that he was excited but focused on their next Premier League game.
“I said we would try to ‘blink’ win the Champions League,” he said. “That’s the same I’m pretty sure for the other seven clubs as well.
“And all the other clubs would say you can lose in the quarterfinals because that’s the nature of the Champions League. We’ll focus on Real Madrid when we get there but at the moment, Everton.
“The feeling is excited but I’d rather speak about Everton because that’s the game tomorrow and the other stuff is a long way away.”
Pep Guardiola is looking to guide City to their first-ever Champions League title but must face a return to Munich to do so. The Spanish coach spent three years as Bayern head coach between 2013 and 2016 and faces stiff competition in Julian Nagelsmann’s side, who knocked out Paris Saint-Germain in the previous round.
Elsewhere, this season’s knockout stages see three Italian teams featuring in the quarterfinals for the first time since 2006.
The quarterfinal first legs will take place April 11-12, with the return legs held April 18-19. The semifinals will be staged on May 9-10 and May 16-17.
This year’s final will be held at the Ataturk Olympic Stadium in Istanbul on June 10.
UCL quarterfinal draw:
Real Madrid (Spain) vs. Chelsea (England)
SL Benfica (Portugal) vs. Inter Milan (Italy)
Manchester City (England) vs. Bayern Munich (Germany)
AC Milan (Italy) vs. Napoli (Italy)
UCL semifinal draw:
Real Madrid/Chelsea vs. Manchester City/Bayern Munich
AC Milan/Napoli vs. SL Benfica/Inter Milan