Last season's semi-finalists Ajax will start their Champions League campaign against unbeaten Greek title winner PAOK Thessaloniki in the third qualifying round, after the draw was made Monday.
Four-time European champions Ajax began in the second preliminary round last July and were one minute from the final before being eliminated by Tottenham's stoppage-time winning goal in May.
As the Dutch league winners, Ajax now start one qualifying round later with the first leg in Greece - needing to beat two opponents instead of three to join the elite group stage.
But they got the toughest possible opposition. Ajax were the highest-ranked seeded team and PAOK was highest ranked in the pot of unseeded teams after being the only unbeaten league winner in Europe last season. Both are in the draw section just for national champions.
Porto, two-time European champions, were paired with Krasnodar in a separate qualifying path for teams that placed second or third in higher-ranked leagues.
Also, Dynamo Kiev will face Club Brugge, and Austria's LASK will take on either PSV Eindhoven, the 1988 European champions, or Basel.
UEFA had to intervene to keep the Russian and Ukraine teams apart and uphold a rule imposed in 2014 across all its competitions for security reasons.
Dynamo Kiev were drawn against Krasnodar, then shifted down to the next fixture slot as the away team. UEFA has separated clubs from the two countries since Russia annexed the Crimea region of Ukraine. Porto were drawn next and paired with Krasnodar.
First-leg games are played August 6-7, and return games on August 13.
The second qualifying round has yet to be played. It begins Tuesday and will be completed on July 31.
Istanbul Basaksehir (Turkey) vs. Viktoria Plzen (Czech Republic) or Olympiakos (Greece)
Krasnodar (Russia) vs. Porto (Portugal)
Club Brugge (Belgium) vs. Dynamo Kiev (Ukraine)
PSV Eindhoven (Netherlands) or Basel (Switzerland) vs. LASK (Austria)
Olympiakos (Greece) or Viktoria Plzen (Czech Republic) vs. Istanbul Basaksehir (Turkey)
Porto (Portugal) vs. Krasnodar (Russia)
Dynamo Kiev (Ukraine) vs. Club Brugge (Belgium)
LASK (Austria) vs. Basel (Switzerland) or PSV Eindhoven (Netherlands)
CFR Cluj (Romania) or Maccabi Tel-Aviv (Israel) vs Celtic (Scotland) or Nomme Kalju (Estonia)
Sutjeska (Montenegro) or APOEL (Cyprus) vs. Dundalk (Ireland) or Qarabag (Azerbaijan)
PAOK Thessaloniki (Greece) vs. Ajax (Netherlands)
Dinamo Zagreb (Croatia) or Saburtalo (Georgia) vs. Ferencvaros (Hungary) or Valletta (Malta)
Red Star Belgrade (Serbia) or HJK Helsinki (Finland) vs. Copenhagen (Denmark) or The New Saints (Wales)
Maribor (Slovenia) or AIK (Sweden) vs. BATE Borisov (Belarus) or Rosenborg (Norway)
Celtic (Scotland) or Nomme Kalju (Estonia) vs. CFR Cluj (Romania) or Maccabi Tel-Aviv (Israel)
Dundalk (Ireland) or Qarabag (Azerbaijan) vs. Sutjeska (Montenegro) or APOEL (Cyprus)
Ajax (Netherlands) vs. PAOK Thessaloniki (Greece)
Ferencvaros (Hungary) or Valletta (Malta) vs. Dinamo Zagreb (Croatia) or Saburtalo (Georgia)
Copenhagen (Denmark) or The New Saints (Wales) vs. Red Star Belgrade (Serbia) or HJK Helsinki (Finland)
BATE Borisov (Belarus) or Rosenborg (Norway) vs. Maribor (Slovenia) or AIK (Sweden).