Article

Table of Contents
Theme:
Was this article helpful?

0  out of  3 found this helpful

Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles!

How to Configure a Private Network on Ubuntu

Last Updated: Thu, Mar 4, 2021
FAQ Networking Ubuntu

Introduction

Vultr provides many flexible networking options for your cloud servers. In addition to the public network attached to every Vultr instance, you can configure up to five private networks per location. Private networks allow instances within a location to communicate without exposing the traffic to the public internet.

Please see the guide How to Configure a Private Network at Vultr for general information about Vultr's private network feature.

Private networks do not have DHCP. When deploying a Vultr cloud server with private networking, you must manually configure the private adapters or supply your own DHCP server. We provide network configuration examples for many popular operating systems, pre-configured for your instance's IP addresses. You can find these by navigating to the settings screen (1) for your server, then selecting IPv4 (2). Follow the networking configuration link (3) to view the configuration examples.

NetworkConfig

The configurations in the customer portal are your best source of specific information. Please see below for step-by-step instructions with generic examples.

Ubuntu 12.xx - Ubuntu 15.xx

Verify that private networking is enabled for your cloud server. Your private network device is eth1. Your public network device is eth0.

Add the following lines to the /etc/network/interfaces file. Replace 10.10.10.3 with your IP address.

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

Verify that private networking is enabled for your cloud server. Your private network device is ens7. Your public network device is ens3.

Add the following lines to the /etc/network/interfaces file. Replace 10.10.10.3 with your IP address.

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

Verify that private networking is enabled for your cloud server. Your private network device is ens7. Your public network device is ens3.

  1. Find the MAC address of the ens7 adapter.

    # ip addr
    
  2. Look for the link/ether value of adapter ens7, as in the example below (00:00:00:00:00:00):

    3: ens7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    
  3. Populate /etc/netplan/10-ens7.yaml with the following text. Replace 10.10.10.3 with your IP address, and 00:00:00:00:00:00 with your MAC address.

    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]
    
  4. Update networking or reboot.

    # netplan apply
    

Manage Private Networks via API

The Vultr API offers several endpoints to manage private networks.

Want to contribute?

You could earn up to $600 by adding new articles