From the support team:
Thank you for contacting us.
There are three ports that must be opened for the game to work: 8181, 5222 and 6967. 6967 is the "gateway" port that the client connects to momentarily to get information on which connection servers are available and their IP addresses. 8181 is the port that client makes a dedicated connection to in order to play the game. 5222 is the port that connects to the chat server.
Sincerely,
The Pokémon Support Team