How to Configure a Private Network at Vultr

Last Updated: Sun, May 17, 2020
FAQ Linux Guides Networking Windows Guides

Introduction

When deploying a VPS with a private network, you need to configure the IP addresses on the private interface. The examples in this guide are for IPv4, however private network interfaces on Vultr VMs support both IPv4 and IPv6. Vultr supports multiple VLANs over a single private network interface with 802.1q tags.

You'll find all the information for your server in the Vultr control panel, under Settings > IPv4. In the example is shown below, the public network address is 192.0.2.123, and the private network address is 10.10.10.3. You'll find complete network configuration examples, generated specifically for your server by clicking the link "View our networking configuration tips and examples."

NetworkConfig


These examples below are similar to what you'll find by clicking the "View our networking configuration tips and examples" link in your control panel. If following these examples, make sure to replace the private address 10.10.10.3 and MAC address 00:00:00:00:00:00 with your server's information.

CentOS

Private networking on CentOS is fully supported at Vultr. For specific examples on CentOS 6, Centos 7, and CentOS 8, please see the article:

Debian 7, Debian 8

Add the following text to the /etc/network/interfaces file.

auto eth1
iface eth1 inet static
    address 10.10.10.3
    netmask 255.255.0.0
    mtu 1450

Start the interface or reboot.

ifup eth1

Debian 9, Debian 10

Add the following text to the /etc/network/interfaces file.

auto ens7
iface ens7 inet static
    address 10.10.10.3
    netmask 255.255.0.0
    mtu 1450

Start the interface or reboot.

ifup ens7

Fedora 24 - 28

Populate /etc/sysconfig/network-scripts/ifcfg-ens7 with the following text.

DEVICE=ens7
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=10.10.10.3
NETMASK=255.255.0.0
NOZEROCONF=yes
IPV6INIT=no
MTU=1450

Restart networking or reboot.

systemctl restart network.service

Fedora 29 - 31

Run the following commands.

nmcli con add con-name private-net ifname ens7 type ethernet ipv4.method 'manual' ipv4.addresses '10.10.10.3/24' 802-3-ethernet.mtu 1450
nmcli con up private-net

FreeBSD 10.x, FreeBSD 11.x, FreeBSD 12.x

Add the following line to the /etc/rc.conf file.

ifconfig_vtnet1="inet 10.10.10.3 netmask 255.255.0.0 mtu 1450" 

Start the interface or reboot.

service netif start vtnet1

OpenBSD 6.x

Add the following lines to the /etc/hostname.vio1 file.

inet 10.10.10.3 255.255.0.0
!ifconfig vio1 mtu 1450

Reboot the system.

reboot

Ubuntu 12.xx - Ubuntu 15.xx

Add the following lines to the /etc/network/interfaces file.

auto eth1
iface eth1 inet static
    address 10.10.10.3
    netmask 255.255.0.0
    mtu 1450

Start the interface or reboot.

ifup eth1

Ubuntu 16.xx, Ubuntu 17.04

Add the following lines to the /etc/network/interfaces file.

auto ens7
iface ens7 inet static
    address 10.10.10.3
    netmask 255.255.0.0
    mtu 1450

Start the interface or reboot.

ifup ens7

Ubuntu 17.10 through 20.04

Populate /etc/netplan/10-ens7.yaml with the following text. Replace the example MAC and IP address information with your information.

network:
  version: 2
  renderer: networkd
  ethernets:
    ens7:
      match:
        macaddress: 00:00:00:00:00:00
      mtu: 1450
      dhcp4: no
      addresses: [10.10.10.3/16]

Update networking or reboot.

# netplan apply

Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

Find the private interface name on your system. You can use ipconfig /all or navigate the Windows Control Panel.

Replace "Ethernet 2" with the private interface name that Windows has chosen and run the following command.

netsh interface ip set address name="Ethernet 2" static 10.10.10.3 255.255.0.0 0.0.0.0 1

Want to contribute?

You could earn up to $300 by adding new articles