How to add static route to configure private networking

This article is related to our U.S. dedicated servers only.

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, AlmaLinux 8/9

  1. 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)

  2. 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 and {interface_name} with your secondary NIC interface name (e.g. eno2, eth1,  enp1s0f1)

  3. Restart networking
    CentOS 7
    service network restart
    AlmaLinux 8/9 
    nmcli connection reload; nmcli connection up ifname {interface_name}

 

 

Ubuntu 18.04, 20.04

  1. Edit the netplan YAML file 
    nano /etc/netplan/01-netcfg.yaml
  2. Add this section under the ethernet in question
    routes:
    - to: 10.0.0.0/8
    via: {gateway}
    on-link: true
    Replace {gateway} with the private network gateway IP.
    Note:
    Text indentation might not be displayed correctly. Please correct the indentations of the above text before using it in the netplan YAML file.
  3. Apply changes
    netplant apply

 

Verify the new static route

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

 

Important
Servers with no static route won't be able to communicate with each other over the private network.

 

 

 

  • static route, routing
  • 774 Users Found This Useful
Was this answer helpful?

Related Articles

How to reinstall an OS on my server?

If you already have an OS installed on your server and want to change or reinstall it, you can do...

How to set rDNS records for my dedicated server IPs?

You can update rDNS records of your server IPs from Client Area (One Portal) Log in to your...

How to change SSH Port on CentOS 6

Open SSH connection to the server, then:1. Type: nano /etc/ssh/sshd_config 2. Press CTRL+W to...

Do you provide KVM/IPMI access?

Yes, we provide KVM access to all servers in all locations.KVM access is free of charge in all...

Can I install a custom OS?

Yes, you can install a custom OS (OS that is not listed on the server order page) by attaching...