Port forwarding

From AssaultWiki
Jump to: navigation, search

Port forwarding, sometimes referred to as port mapping, is the act of forwarding a network port from one network node to another. This technique can allow an external user to reach a port on a private IP address (inside a LAN) from the outside via a router.

Overview

At first glance it sounds totally easy and logical: Every AssaultCube server needs access to the World Area Network (WAN) to be able to communicate with the masterserver and other AssaultCube clients. However, this is probably the most overlooked problem when creating (or better, registering) a server. Many people who try to make their own server do not know or have forgotten that their Local Area Network (LAN), which is established between the user's computer and the router, is working like a sandbox. The router normally has no idea which (incoming) data from the WAN has to pass to which local computer. As a result, the server isn't able to register to the Master Server, which looks like this:

Masterserver noping.jpg


Without access to the Master Server the new server won't appear in the serverlist at any client, because this list is just another interpretation of the Master Server's content. The new server is probably accessible from your own client with the menu option "Join a LAN server". If so, then this shows that the basic server settings might be correct, but the server itself is bound to the LAN.

To solve this you have to tell the router which ports have to be open and to which ports on which local client computer it has reroute the incoming data (of course this depends to the outgoing data also). This is absolutely necessary if you are planning to run multiple servers on one or different machines where each server has a different port.

Port forwarding - scheme.jpg

Forwarding the ports

To forward a port you have to find out three things:

  • The internal IP-address of the machine on which the server is running.
This is not the external IP address, which you are getting from your internet service provider! It's the IP address of the particular computer in the LAN (given via DHCP by the router or manually set to a static IP address by the user).
  • The first port number on which game data will be interchanged,
This is port 28763 by default.
  • The second port number on which additional information will be interchanged, which is the first port +1.
This is port 28764 by default.
Example of a portfoward setup for two AssaultCube servers

The next step is to get into the router configuration which is accessible in the most cases by entering the router's IP address (Gateway) (ex. 192.168.1.1) or by using a factory defined domain name (e.g. fritz.box for all routers of the Fritz!-corporation) in a normal web browser. If you want to get your router's gateway ip on a windows computer, open a command prompt, type in ipconfig, then hit enter. Most of the time this ip when entered in a web browser will take you to your router's configuration wizard. Because the router configuration menus differ from model to model, it is impossible to give detailed step-by-step-help here on how to port forward. It might be useful to look at www.portforward.com where several models and their menus are described but for the most part, look for either Firewall settings or Advanced settings or something that says Port forwarding and if you must continue to look for an add applications tab.

Once the settings for port forwarding in the own router configuration menu have been found, the next step is to add a new entry for UDP transport. The User Datagram Protocol is used for sending and receiving game data and for pinging a server (and not the TCP/IP). This entry should have a description (e.g. "My AC server"), the used protocol (here: UDP), the ports to forward at the router (by default 28763-28764), the target machine (its internal IP) and the ports on which the router ports have to be forwarded (by default 28763-28764 also). If you do not know your computer's internal target address, on a windows computer you can open a command prompt and type in ipconfig to retrieve your value. After entering and activating these values in the router, it is recommended to do a test run and also to make sure that your ports are open in your computer's firewall settings. If everything has been done correctly, the registering of your AC server should be successful. The screen looks then like this:

Masterserver success.jpg

How to forward ports

Choose your router brand:

See also

Troubleshooting

If you think you forwarded your ports and yet you are still getting the error "WARNING: master server registration failed: failed pinging server" then try these step.

  • Check that you forwarded both ports, port and port+1 (by default 28763 and 28764)
  • Check that you forwarded the ports that you specified in your server configuration file.
  • Check that you forwarded both ports using the UDP protocol or "Both"
  • Check to make sure that both ports are enabled (usually a little check box).
  • Check that you forwarded both ports to the correct internal IP, note that if you have restarted, or disconnected your computer it may of changed the internal IP. This is the most common issue for servers that just stop working. If you have this issue a bunch, try DHCP reservation
  • Check your firewall to make sure it is allowing those ports and the server through. Check both the router firewall and computer firewall. If parental controls are in place, sorry, without access to those you cannot make a server.
  • Try turning your router off, wait a few seconds, and turn it back on. Some routers need a little kick to start forwarding their ports.

External links