With OVHcloud Failover IPs, connecting your virtual machines to the Internet can be a breeze. Follow this tutorial to configure networking on your Ubuntu 16.04 VM.
- Dedicated Server running VMware ESXi 6.5
- How to Connect a VM to the Internet Using VMware ESXi 6.5
- Configuring Network Settings in an Ubuntu 16.04 VM
Configuring Network Settings in an Ubuntu 16.04 VM
In this step, we will be configuring our interface settings. To do this, you must first open your interface configuration file. Do so in a text editor of your choice using the following command:
$ sudo vi /etc/network/interfaces
Edit the interfaces file to make it appear as follows:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto ens160 iface ens160 inet static address x.x.x.x netmask 255.255.255.y gateway z.z.z.254 dns-nameservers 22.214.171.124 126.96.36.199
In this file, replace the following pieces of information as instructed:
- 1. If you replace the VMXNET3 NIC with another one, your NIC may use a different naming convention. If it does, replace all instances of "ens160" in the file with the name of your interface. If you don't know the name of your interface, you can find it using the following command:
$ ip addr list
- 2. Next to "address", replace "x.x.x.x" with the Failover IP to which you have added the vMAC in the OVHcloud Manager.
- 3. Next to "netmask", replace the "y" in the final octet with the correct number depending on the size of the block of IPs you have purchased. For instance, if you are using a /29 block, put "248" in the last octet.
- 4. Next to "gateway", replace the "z.z.z." with the first three octets of your Dedicated Server's IP address with a final octet of "254". For instance, if your Dedicated Server IP was 188.8.131.52, you would use 184.108.40.206 as your gateway.
- 5. The DNS name servers listed are from OpenDNS. Feel free to use other name servers here, if you choose.
Now you will need to bring your NIC online. To do so, enter the following command:
$ sudo ip link set ens160 up
Finally, restart your networking service using the following command:
$ sudo systemctl restart networking
To test that the VM is fully connected to the Internet, ping example.com. If you get a response, you are good to go. If you do not, restart your VM and attempt the ping again.
Having read this article, you should be familiar with the steps that are required to configure the network settings on an Ubuntu 16.04 VM.