Private networks for VPS on Debian

Step-by-step guide to setting up a private network between VPS servers on Debian.

Private networks allow you to connect multiple VPS servers into a single closed network within the data center. All traffic between them passes through an internal channel without accessing the internet.

This provides enhanced security and significantly higher data exchange speeds compared to the public network.

Important

Private networks are available only for VPS located in the same location (one data center). High Availability (HA) tariffs do not support this feature.

Activate the private network

  1. Log in to your Fornex Dashboard.
  2. Go to the section Virtual servers → Private network.
  3. Create a new private network or select an existing one.

Private network VPS section on Fornex Private network VPS section on Fornex

  1. Add the required VPS servers to the network (they must be in the same location).

Setting up private network for VPS in Fornex Setting up private network for VPS in Fornex

Don't have a VPS yet?

Fornex offers VPS hosting with full root access, 24/7 support, and DDoS protection. Get a stable server with NVMe disks for fast and reliable operation. Find more details on the Fornex VPS page.

Configure the network interface on VPS

To make the private network work, you need to manually configure the second network interface on each server. The address range is 192.168.1.0/24.

You can use any free IP from this range, except .1 and .255.

Example configuration on Debian 11/12/13

  1. Connect to the VPS via SSH and check for the second interface:
ip a

You will see the eth1 interface (or ens7) in еру DOWN state.

  1. Edit the network configuration file:
nano /etc/network/interfaces

The example of the full file:

auto lo
iface lo inet loopback

  # Primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address your_public_IP
    netmask 255.255.255.0
    gateway your_gateway
    dns-nameservers 1.1.1.1 8.8.8.8

  # Private interface for the local network
auto eth1
iface eth1 inet static
    address 192.168.1.10/24
    netmask 255.255.255.0

On the second server, specify a different IP, for example 192.168.1.15/24.

  1. Restart the network services to apply the changes:
/etc/init.d/networking restart

Or

sudo ifdown eth1 && sudo ifup eth1

Or (on systems with systemd):

systemctl restart networking
  1. Check the result:
ip a | grep eth1

For example:

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.1.10/24 brd 192.168.1.255 scope global eth1

The eth1 interface should be in UP state with the assigned private IP.

Check the private network operation

From one server, ping the private IP of the second server, specifying the interface:

ping -c 5 -I eth1 192.168.1.15

You should see successful responses with low response time (usually < 1 ms):

PING 192.168.1.15 (192.168.1.15) from 192.168.1.10 eth1: 56(84) bytes of data.
64 bytes from 192.168.1.15: icmp_seq=1 ttl=64 time=0.590 ms
64 bytes from 192.168.1.15: icmp_seq=2 ttl=64 time=0.480 ms
64 bytes from 192.168.1.15: icmp_seq=3 ttl=64 time=0.610 ms
64 bytes from 192.168.1.15: icmp_seq=4 ttl=64 time=0.570 ms
64 bytes from 192.168.1.15: icmp_seq=5 ttl=64 time=0.460 ms

--- 192.168.1.15 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4071ms
rtt min/avg/max/mdev = 0.460/0.542/0.610/0.062 ms

Now your VPS servers can securely and quickly exchange data within the closed network.

Help

If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!

Need help?Our engineers will help you free of charge with any question in minutesContact us