The Catalan powerhouse and Los Blancos will face lower-division opposition just like other La Liga sides such as Atletico Madrid, Valencia and Athletic Bilbao
The Catalans beat Athletic Bilbao 3-0 in the final of the competition last season, but they will now have to deal with the 2001 Uefa Cup runners-up first if they are to defend their title.
Real Madrid, meanwhile, will also meet a Segunda B side in the form of minnows Alcoyano, and could meet Barcelona in the semi-finals of the competition if both teams make it to that stage of the Spanish cup.
Furthermore, Valencia will have to deal with Llagostera, while Atletico Madrid lock horns with Real Jaen, Bilbao meet Eibar, and Malaga face Cacereno.
The first leg of the round of 32 takes place on October 31, with the return scheduled for November 28.