Anderson won three tie-breaks to secure his place in the quarter-finals of Wimbledon for the very first time.
The South African made it all the way to the US Open final last year before losing to Rafael Nadal and will now face his great rival and world No 2 Federer in the last eight of Wimbledon.
But he only learned of the match-up when he was told by a journalist during his post-match interview.
“I don’t even know the draw. Do I play Roger?” Anderson said before having the quarter-final confirmed.
“Obviously there’s not much explaining what one needs to do. What a great opportunity. He’s the greatest grass-court player of all time.
“But right now the most important thing is to recover.
“It was very gruelling.
“My priority is to enjoy getting through, try to recover and then get ready for a very tough match.”
Anderson and Federer have met four times previously and the Swiss has triumphed on each occasion.
The 32-year-old has never even taken a set off the eight-time champion but will draw confidence from the fact that before today, he had never beaten Monfils either.
“He’s a very tough opponent to play. I tried to stay in the moment as much as possible. You just have to try to keep looking forward,” Anderson added.
“I thought it was a really high quality match. I really had to dig deep.
“I really had to battle hard. Obviously really really pleased.
“I’ve played Gael a few times and its the first time I’ve ever beaten him.
“He’s a very tough opponent to play. I tried to stay in the moment as much as possible.
“You just have to try to keep looking forward.”