"I felt good, less nervous than in the first round", Federer said.
Serena Williams progressed into the third round with a dominant straight-set win over Bulgaria's Viktoriya Tomova.
Venus Williams was also in action on Wednesday.
The ninth-seeded American had struggled in the opening set of her first-round match with Johanna Larsson, but roared back to win. Venus reached her ninth Wimbledon final a year ago, but the American star was denied a sixth title by Garbine Muguruza. It was her earliest exit at a Slam since a first round defeat at the 2010 Australian Open. Making her 21st Wimbledon appearance, 38-year-old Venus is the oldest woman in this year's tournament. In the third set, Federer broke Lacko in the fifth game to take a commanding 4-1 lead before winning the final two games to finish off the match. Asked if her wealth of Wimbledon experience was a key factor, Venus said: "I'd love to have that extra advantage. If that's your best or not doesn't matter".
Dutchwoman Kiki Bertens is also through with a 6-4, 6-0 result against Russian Anna Blinkova, but Poland's Agnieszka Radwanska is out following a 7-5, 6-4 loss to Czech Lucie Safarova.
The former beat Viktoriya Tomova, while the latter overcame Lukas Lacko, but second seed Caroline Wozniacki crashed out at the hands of Ekaterina Makarova. Romanian 29th seed Mihaela Buzarnescu thrashed British teenager Katie Swan, 6-0, 6-3 to extend her remarkable renaissance.
Pakistan ex-PM Nawaz Sharif given 10-year jail term
Sharif's political opponents hailed the verdict, saying it was the beginning of real "accountability of thieves". Already PML-N has faced mass desertions with some of Nawaz's long-time allies also jumping ship.
Raonic reached the third round for a sixth straight year, having lost to eventual champion Roger Federer in last year's quarter-finals.
Elsewhere, American world No.13 Sam Querrey eliminated Sergiy Stakhovsky of Ukraine 7-6 (7-4) 6-3 6-3 while Russia's Daniil Medvedev, earned a straight-set victory over world Guillermo Garcia-Lopez of Spain 6-3 6-4 6-2.
It was another dominant display by the eight-time champion, who lost just nine of 61 points on his serve in total and broke Lacko five times, including with a forehand victor to close out the match.
Serena, seeded 25th after her return from maternity leave, faces France´s Kristina Mladenovic for a place in the last 16.
Wozniacki, plagued by an invasion of flying ants during the Court One clash, saved five match points but has now failed to get past the last 16 in 12 visits to the All England Club. "I expected more from the team", Federer, who has given Switzerland plenty to cheer about as he collected 20 Grand Slam titles over the past 15 years, told reporters at Wimbledon on Wednesday.
LONDON-Roger Federer and Serena Williams are making it look easy at Wimbledon - again. She's had a really good year last year.
- Scott Pruitt resigns from EPA
- Mom shoots man who stole SUV with kids inside
- Billionaire Elon Musk Offers Help for Cave 13
- ISIS leader al-Baghdadi's son 'killed in Syria'
- Beryl becomes first hurricane of 2018's Atlantic hurricane season
- Charges laid in Humboldt Broncos bus crash that killed 16 people
- HHS now estimates under 3,000 kids separated from parents in government custody
- Thai authorities say boat death toll at 10
- Apple Music might have overtaken Spotify and have more paying U.S. subscribers
- Northern white rhino could be saved from extinction using embryos