Setting up a Tibia proxy avoids this common connection problem. A Tibia proxy is a special Internet server (separate from the game server) that does not require a port 7171 connection. Instead, the Tibia proxy server will accept requests on alternative network ports (such as port 80) that will typically not be restricted by firewalls / proxies. The Tibia proxy, in turn, makes its own direct connection to the game server (on port 7171) and translates messages between the Tibia server and your client in real time to allow game play.
To set up a Tibia proxy, simply obtain a list of Open Tibia proxy servers and their IP addresses from gaming forums and configure your client to use them. The list of active Tibia proxies and addresses changes regularly. Take care in choosing a good Tibia proxy as some may suffer from slow network performance or be operated by questionable parties seeking to steal account information.