After Lee Martin had an effort cleared off the line and debutant Sam Walker in the Rovers goal had saved from Michael Chopra, Jason Scotland and Jay Emmanuel-Thomas, the League Two team went ahead against the run of play in the 26th minute through Michael Smith's superb 30-yard curler.
Ipswich responded well with Walker denying Chopra on two more occasions before Scotland found the bottom left-hand corner with a precise finish from the edge of the box five minutes before half-time.
The Championship club went ahead after 56 minutes. Tommy Smith headed home the resulting corner after Chopra's penalty had been pushed wide by Walker, who was signed on loan from Chelsea just hours before kick-off.
Ipswich dominated possession thereafter but it took them until the 84th minute to put the tie beyond Rovers.
A flowing move culminated in Emmanuel-Thomas cutting in from the right and curling a left-foot shot towards the top corner. Walker made a superb save to claw the ball away but could only push it on to the head of Aaron Cresswell who nodded in from six yards.