Rangers will travel to Ayr United in the second round of the Petrofac Training Cup.
Trophy holders Livingston are away to Championship rivals Queen of the South, with St Mirren making the trip to Annan Athletic.
Falkirk, four-time winners of the trophy, are at home to Peterhead, while Stenhousemuir host Raith Rovers and Dunfermline visit Forfar.
The midweek ties will be played on 18 and 19 August.
Ayr, managed by former Rangers winger Ian McCall, opened with a 3-1 win at home to Albion Rovers, while the Ibrox side demolished Hibernian 6-2 at Easter Road in round one on Saturday.
The teams met earlier this month in a friendly at Rangers' Auchenhowie training ground, with Mark Warburton's side winning 2-0.
Petrofac Training Cup - second round draw:
Forfar Athletic v Dunfermline Athletic
Falkirk v Peterhead
Alloa Athletic v Elgin City
Stenhousemuir v Raith Rovers
Annan Athletic v St Mirren
Ayr United v Rangers
Queen of the South v Livingston
Queen's Park v Dumbarton