The Welshman has signed a two-year deal with the now-Championship club following his release from Ipswich Town last month.
Cornell, who has represented Wales at U21 level, started his career with Swansea City and was the second choice shot-stopper for his hometown club in the Premier League.
He made over 100 appearances for the Cobblers between 2016 and 2020 but was released by then-manager Keith Curle before joining Ipswich.
Posh boss Darren Ferguson said: "I am really pleased, it is a good signing for us. He is at a really good age, he has a lot of experience and he will come in and really challenge Christy (Pym) for the number one slot and that is what we need. I am delighted to get it sorted and look forward to working with him."
Cornell added: “It is a great opportunity for me, the club had a wonderful campaign last season and secured promotion to the Championship, and I want to come in and challenge for that number one position.
"I was grateful that the club wanted to get the deal done quickly and I can now look forward to meeting the lads and start forming relationships, particularly with the goalkeepers we have at the club and the coach Mark Tyler.
“When I heard about the interest, it was a move that excited me straight away. To potentially play at Championship level is exciting and it is one that I am really looking forward too. I want to come in, work hard and get settled as quickly as I can.
Cornell is Peterborough's first signing of the summer, but six of the current squad have put pen to paper on new deals since the promotion to the Championship.