One of the more painful aspects of setting up a private realm is getting your
address_translation.conf file setup correctly. It still causes me problems each time I setup a new realm!
As realms are not always run on a single public facing server the
address_translation.conf file is required to inform the game server what port forwarding is in effect.
The conf file is split into several sections to help keep track of the different records that are required:
- w3route server ip - This is used for Warcraft 3 so I shall ignore this for now but is pretty similar to the other sections
- Game Translations for clients - This section is used to define clients that are playing from inside the network
- Diablo II Charactar Server (d2cs) - This section sets up the forwarding required to get from your gateway / router to d2cs
- Diablo II Game Server (d2gs) - This section sets up the forwarding required to get from your gateway / router to d2gs
Diablo uses two different network topologies depending on if the realm is Open or Closed. For Closed it uses a Star Topology which means all client traffic goes to the game server and then is repeated back out to the other clients. Open realms instead use a Mesh Topology where each client sends its traffic to every other client.
You need to keep both of these in mind as it will help you plan out what translations you need to setup. Since all traffic goes through D2GS for Closed realms you only need to setup translations for clients outside the network to contact the game server. However for Open realms you will also need to setup translations for each client within the network.
Each address translation is made up of 4 parts:
- The original address
- The translated address
- Client addresses that should be excluded from the translation
- Client addresses to include in the translation
For example, The game server is being run on a normal home internet connection. The game servers original address might be
192.168.1.100, however this IP will be inaccessible for anyone outside the local network. The external IP for the home internet is
126.96.36.199. First we need to setup port forwarding on the router to forward ports
6112 - 6114,
192.168.1.100, Next we need to setup address tranlation to use the port forwards. However we only want to translation to happen for clients outside of the local network as they can already access the server, Therefore we set the exluded addresses to
/24 is a netmask and translates to
The D2GS entry that we need to add to
192.168.1.100:4000 188.8.131.52:4000 192.168.1.0/24 ANY
The D2CS entry that we need to add to
192.168.1.100:6112 184.108.40.206:6112 192.168.1.0/24 ANY
For Open realms we also need to setup port forwards and translations for each internal client. So for client
192.168.1.50 we need to add a port forward on the router for port
6112, however as this external port is already being forwarded to the game server we need to pick a different external port. Lets use port
6118 externally. Below is the address translation record, you will see that it is not only translating the IP address but also the port:
192.168.1.50:6112 220.127.116.11:6118 192.168.1.0/24 ANY