This article is related to our U.S. dedicated servers with private network connectivity.
To ensure the proper functioning of private networking on your dedicated server, you must establish a static route for the 10.0.0.0/8 network. Follow the relevant instructions below based on your Linux distribution.
CentOS 7/8, AlmaLinux 8
- Create a route file
nano /etc/sysconfig/network-scripts/route-{interface_name}replace{interface_name}with your secondary NIC interface name (i.e. eno2, eth1, enp1s0f1) - Add the following to the route file
10.0.0.0/8 via {gateway} dev {interface_name}replace{gateway}with your private networking gateway IP address and{interface_name}with your secondary NIC interface name (e.g. eno2, eth1, enp1s0f1) - Restart networking
CentOS 7service network restart
AlmaLinux 8/9nmcli connection reload; nmcli connection up ifname {interface_name}
Almalinux/RHEL/RockyLinux 8/9/10 (NetworkManager CLI)
Using NetworkManager CLI you can easily add/remove static routes with a simple command.
- Use this command to add a static route to interface eth1:
- Replacenmcli connection modify eth1 +ipv4.routes "10.0.0.0/8 <Gateway_IP>"10.0.0.0/8with the private network IP range.
- Replace<Gateway_IP>with the private network gateway IP.
- Replaceeth1with your server's interface name. - Reload the connection profiles and restart
eth1interface:
nmcli connection reload nmcli connection up ifname eth1Replace eth1 with your server's interface name.
- Verify the static route with this command, it'll show all ipv4 static routes:
ip -4 route - Done! Now you've added a static route.
- You can remove the static route with this command:
- Replacenmcli connection modify eth1 -ipv4.routes "10.0.0.0/8 <Gateway_IP>"10.0.0.0/8with the private network IP range.
- Replace<Gateway_IP>with the private network gateway IP.
- Replaceeth1with your server's interface name.
Ubuntu (netplan)
- Edit the netplan YAML file inside
/etc/netplan/nano /etc/netplan/50-cloud-init.yaml
Note: If you didn't find this file, look for a.yamlfile inside/etc/netplan/ - Add this section under the ethernet/interface in question
Replaceroutes: - to: 10.0.0.0/8 via: {gateway} on-link: true{gateway}with the private network gateway IP address.
Note:
Text indentation might not be displayed correctly. Please correct the indentations of the above text before using it in the netplan YAML file. - Apply changes
netplan apply
Windows
- Open CMD as Administrator
- Execute the command
route -p ADD 10.0.0.0 MASK 255.0.0.0 {gateway_IP}Replace{gateway_IP}with the private network gateway IP address. - It should print OK! on success.
Verify the new static route on Linux
You can check the created route using the following command:
ip route
You should find the new route among other system-created routes. The output will be similar to:
10.0.0.0/8 via 10.2.2.1 dev enp1s0f1 proto static onlink
Servers with no static route won't be able to communicate with each other over the private network.
