TeamViewer can use multiple ports for outbound connections, but using its preferred port will deliver optimal performance.
TCP/UDP Port 5938
Its preferred method of establishing outbound connections is through TCP/UDP Port 5938. In a TeamViewer environment, your firewall should have this port open. TeamViewer demonstrates the best performance when using port 5938.
TCP Port 443
If the preferred port 5938 is not available, the next choice for TeamViewer connections is port 443. The iOS and Windows Mobile apps do not use this port. When deploying custom modules with a Group Policy defined in the Management Console, ensure port 443 is open on all machines that will use the application. TeamViewer also uses port 443 to check for updates.
TCP Port 80
When ports 5938 and 443 are not available, TeamViewer will try to connect over TCP port 80. Port 80 is only used as a last resort for several reasons. It’s less reliable than the other ports and offers slower connection speed because of additional overhead requirements. There is also no automatic restart for lost connections. Android and iOS devices may use port 80, but Windows Mobile does not allow it.
Windows Mobile
The Windows Mobile platform restricts apps to using a single outbound port. Connecting out from the device requires the use of port 5938. You may get a message telling you to check your Internet connection when using TeamViewer on a mobile device. This is most likely caused by that port being blocked by your router, firewall, or the data provider.