Depending upon the configuration of your server you may need to be more aware of its IP address configuration and how it relates to your game server.
This guide is not designed to be an in-depth guide to networking, instead focusing on parts relevant to game servers.
All computers will have some sort of network interface (ethernet, fiber optic, wi-fi) to connect to a network. On Linux, you can see your server's interfaces by using the following command.
ip -o link show
Typically you may see (depending on distro) a
localhostloopback interface and an
eth0(Ethernet) is used for your standard copper network cable and is what you will likely see. If you have multiple interfaces you may also see
eth2, etc. More advanced setups can choose to bond together interfaces to work as one to increase bandwidth and resilience.
Some servers may be connected to a VPN (Virtual Private Network) using software such as Wireguard or OpenVPN. This normally creates its own interface that gets allocated an IP address. It is possible to use a VPN to create a private connection to a LAN server
Each network interface can be allocated an IP address either manually on the server or via DHCP. If you are using a provider an internet IP address is normally automatically allocated to your server. For a local network, your router DHCP server will allocate a local IP address. A local IP address can be reserved using DHCP or you can manually set an IP on the server.
Game Servers will typically bind (attach a network socket) to all available IP addresses making the game server available on all networks. However, sometimes a particular IP address may need to be specified if you only want a particular network to access it or the game server requires it.
The simplest and most common server configuration will have one network interface and thus one IP address. When your game server starts it will simply listen and bind to this IP address.
Some servers will have multiple network interfaces available, allowing for multiple IP addresses to be assigned to your server. In this configuration, a server might listen and bind itself to all IP addresses or just one (depending on the game server).
If you have multiple interfaces you may choose to multihome your server. This simply means each interface is on a different network. For example,
eth0is on the
eth1is on the
wg0(WireGuard VPN) is attached to
10.0.0.0. While it is unlikely there is a specific use case for game servers to use multiple networks you need to be aware of what IP addresses your server is bound to.
The 0.0.0.0 IP is a meta-address means non-specific or all addresses. When you set up a game server you may notice the IP address 0.0.0.0 in command line parameters and settings. It is the default IP for game servers just signifies that the game server can bind to all available server IP addresses.
Unless a specific IP address is required the game server IP can be set to 0.0.0.0.
If your server is hosted on the internet using a server provider you should have been allocated a public internet IP address that will be accessible by everyone on the internet.
Using a home server or virtual machine on your desktop is a great way to get started with LinuxGSM. However, a local network (LAN) may require a better understanding of networking, how local IP addressing works, and technologies such as DHCP and NAT.
When a server is hosted on a local network it will be given a private IP address that is only accessible to other devices on your local network. This is fine if you want to get friends around host a game server for a good old-fashioned LAN party. But if you want to allow online players access to your local game server you will need to configure your home router's firewall and setup port forwarding using NAT.
A relatively new technology is starting be become popular that allows applications hosted (think self-hosted web applications) on a private network to be accessed on the internet via a network "tunnel". This typically involves running a tunnel client in the private network that points to a specific internal IP and port. This bypasses the need to port forward on a router. Currently, there is a service called playit.gg that is specifically designed for game servers. However other solutions may work.