Skip to content

Commit

Permalink
GITBOOK-344: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 authored and gitbook-bot committed Nov 22, 2023
1 parent 8ea4f51 commit 118c689
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 33 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [Running Multiple Game Servers](configuration/multiple-game-servers.md)
* [Local/Home Server](configuration/local-home-server.md)
* [LinuxGSM Stats](configuration/linuxgsm-stats.md)
* [IP Address Configuration](configuration/ip-address-configuration.md)
* [Commands](commands/README.md)
* [install](commands/install.md)
* [start-stop-restart](commands/start-stop-restart.md)
Expand Down
17 changes: 17 additions & 0 deletions configuration/ip-address-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: How LinuxGSM handles IP addresses
---

# IP Address Configuration

{% hint style="info" %}
Make sure you understand basic [IP addressing](../networking/ip-address.md).
{% endhint %}

By default, LinuxGSM will use the [0.0.0.0](../networking/ip-address.md#0.0.0.0) meta-address. This behavior will allow the game server to bind to **all** interfaces and allow LinuxGSM to [quer](../commands/monitor.md)[y](../commands/monitor.md) all available IP addresses. If there are multiple IP addresses available, [details](../commands/details.md) will display 0.0.0.0. 

Internet IP: LinuxGSM will try to gather the server's internet IP address to be shown in [details](../commands/details.md).

Specific IP: If a specific IP address needs to be set it can be done using the `ip` setting in the [LinuxGSM ](linuxgsm-config.md)or [game server ](game-server-config.md)config files. Depending upon the game server this will allow it to _bind_ to a specific IP address

Display IP: If you want to change the IP address displayed in alerts you can use the [displayip](../alerts/#display-ip).
61 changes: 28 additions & 33 deletions networking/ip-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,49 @@ Depending upon the configuration of your server you may need to be more aware of
This guide is not designed to be an in-depth guide to networking, instead focusing on parts relevant to game servers.
{% endhint %}

## Internet Server vs. Local Server
## Network Locations

Your game server can be hosted online using a server provider such as Linode or on a [local network](../configuration/local-home-server.md) at home for either local-only LAN parties or allowing online players in through your router. 

### Internet (Public)

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. 

### Local Networks (Private) 

Your game server can be hosted online using a server provider such as Linode or on a [local network](../configuration/local-home-server.md) at your house for either local-only LAN parties or allowing online players in through your router. 
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 equipment, how local IP addressing works, and technologies such as [DHCP](https://en.wikipedia.org/wiki/Dynamic\_Host\_Configuration\_Protocol) and [NAT](https://en.wikipedia.org/wiki/Network\_address\_translation).

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.

## Network Interfaces

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.
All computers will have some sort of physical or virtual [network interface](https://en.wikipedia.org/wiki/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 `localhost` loopback interface and an `eth0` interface. The `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 `eth1`, `eth2`, etc. More advanced setups can choose to bond together interfaces to work as one to increase bandwidth and resilience. 

## IP Address

An IP (Internet Protocol) address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two primary functions: host or network interface identification and location addressing. IP addresses enable devices to send and receive data within a network, facilitating communication and data transfer across the Internet.

1. **LAN IP Address:**
* Example: 192.168.1.10
* Explanation: In a typical home or office network, devices are often assigned private IP addresses within the range defined by the Internet Engineering Task Force (IETF) for private networks. The "192.168.1.10" address is an example of a private IP address commonly used within a LAN. Each device on the local network would have a unique private IP address for internal communication.
2. **Internet IP Address:**
* Example: 203.0.113.45
* Explanation: Internet IP addresses, also known as public IP addresses, are assigned by Internet Service Providers (ISPs) and are globally unique. The "203.0.113.45" address is an example of a public IP address. Websites, servers, and other devices connected to the Internet have public IP addresses that are used for communication between different networks on a global scale. These addresses are essential for routing data across the Internet.

### Virtual Private Networks

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

## Tunneling

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](https://playit.gg/) that is specifically designed for game servers. However other solutions may work.

## IP Address Allocation

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.
Expand All @@ -49,33 +74,3 @@ The 0.0.0.0 IP is a meta-address means non-specific or all addresses. When you s
{% hint style="success" %}
Unless a specific IP address is required the game server IP can be set to 0.0.0.0.
{% endhint %}

## Network Locations

### Internet (Public)

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. 

### Local Networks (Private) 

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.

#### Tunneling

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](https://playit.gg/) that is specifically designed for game servers. However other solutions may work.

## How LinuxGSM handles IP addresses

By default, LinuxGSM will use the 0.0.0.0 meta-address. This behavior will allow the game server to bind to all interfaces and allow LinuxGSM to [quer](../commands/monitor.md)[y](../commands/monitor.md) all available IP addresses. If there are multiple IP addresses available, [details](../commands/details.md) will display 0.0.0.0. 

Internet IP: LinuxGSM will try to gather the server internet IP address to be shown in [details](../commands/details.md).

Specific IP: If a specific IP address needs to be set it can be done using the `ip` setting in the [LinuxGSM ](../configuration/linuxgsm-config.md)or [game server ](../configuration/game-server-config.md)config files. 

Display IP: If you want to change the IP address displayed in alerts you can use the [displayip](../alerts/#display-ip).

##

##

0 comments on commit 118c689

Please sign in to comment.