Queen of the South's reward for beating Scottish League Cup holders St Mirren is an away tie against Hearts.
Stranraer and Hamilton, who eliminated Ross County and Kilmarnock this week, will meet Hibernian and St Johnstone, respectively, in round three.
Celtic host Morton, Motherwell visit Livingston and there's an all-Scottish Premiership clash between Dundee United and Partick Thistle.
Dundee v Inverness and Falkirk v Aberdeen are the other ties.
The matches, which must be played to a finish using extra-time and penalties if necessary, will be played on the 24 and 25 September.
Scotland's European representatives Celtic, Hibernian, Motherwell and St Johnstone as well as Inverness, who finished fourth in the top flight last season, enter the tournament at this stage.
Scottish League Cup third round
Hibernian v Stranraer
Dundee v Inverness
Celtic v Morton
Livingston v Motherwell
Hearts v Queen of the South
Falkirk v Aberdeen
Dundee Utd v Partick
Hamilton v St Johnstone
Ties to be played on 24 and 25 September.