The draw was held in Nyon, Switzerland on Friday.
Last time the duo met was in the 2013/2014 UEFA Champions League semifinal which Madrid won 5-0 on aggregate.
First leg will be played at Allianz Arena as Bayern Munich welcome Real Madrid.
In another difficult draw, Serie A champions Juventus will welcome Barcelona to the Juventus Stadium for the first leg.
Barcelona beat Juventus 3-1 in the 2014-2015 Champions League final.
In other pairings, Premier League champions Leicester City, who parade Nigerian pair Wilfred Ndidi and Ahmed Musa, will face Atletico Madrid, while Borussia Dortmund will battle AS Monaco.
The quarter-final first legs will hold 11th and 12th, April, while the second legs will be played 18th and 19th, also in April.