You will find below the steps required to configure your private network for Linux distributions (Netplan & interfaces file). Simply replicate the following setup on every VPS defined in your network. Each VPS needs its own private network IP address (e.g., 10.0.0.2, 10.0.0.3, 10.0.0.4).
Ubuntu 20.04 / 22.04 / 24.04 and Debian 11 / 12
1. Identify your network interface
ip addr
2. Edit the Netplan configuration
sudo nano /etc/netplan/01-netcfg.yaml
3. Add the following configuration
network:
version: 2
renderer: networkd
ethernets:
eth1:
dhcp4: no
addresses:
- YourAssignedIP/24 # (e.g., 10.0.0.2)
4. Apply the configuration
sudo netplan apply
Debian older versions (using /etc/network/interfaces)
1. Edit the interfaces file
sudo nano /etc/network/interfaces
2. Add the following lines
auto eth1
iface eth1 inet static
address YourAssignedIP # (e.g., 10.0.0.2)
netmask 255.255.255.0
3. Restart the networking service
sudo systemctl restart networking
CentOS 9 Stream / AlmaLinux 8 & 9 / Rocky Linux 8.6 & 9.x
1. Navigate to the network scripts directory
cd /etc/sysconfig/network-scripts/
2. Create or edit the interface configuration file
sudo nano ifcfg-eth1
3. Add the following configuration
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
IPADDR=YourAssignedIP # (e.g., 10.0.0.2)
NETMASK=255.255.255.0
4. Restart the network service
sudo systemctl restart NetworkManager
Additional notes
-
- Firewall configuration: ensure that your firewall settings allow traffic through the private network interface.
-
- No gateway required: typically, a gateway is not needed for the private network to operate.
-
- Avoid conflicts: ensure the IP range you select does not overlap with other networks you are connected to.
Choosing an IP range
| Private range | Span |
|---|---|
10.0.0.0/8 |
10.0.0.0 – 10.255.255.255 |
172.16.0.0/12 |
172.16.0.0 – 172.31.255.255 |
192.168.0.0/16 |
192.168.0.0 – 192.168.255.255 |
Testing connectivity
You can test the connection by pinging another device on the private network:
ping OtherDeviceIP # (e.g., 10.0.0.2)