The world number three, who dropped out of last month's French Open, had little trouble swatting aside Tunisia's Malek Jaziri, 6-3, 7-5, and next faces Belgium's David Goffin.
Federer, who is in the twilight of a sparkling career and turns 35 in August, is chasing a ninth title in Halle, Germany.
He has yet to win a title in 2016, his longest drought to start a year since he went title-less in 2000.
Goffin set up the meeting after Ukraine's Sergiy Stakhovsky retired from their clash.
Also into the next round is home hope Philipp Kohlschreiber, the eighth seed, who beat Ivo Karlovic of Croatia 6-7 (7/9), 6-4, 7-5.
The indefatigable Kohlschreiber was playing for a 10th straight day.