With OVHcloud Failover IPs, connecting your virtual machines to the Internet can be a breeze. Follow this tutorial to configure networking on your Ubuntu 18.04 VM.
- Configuring Network Settings in an Ubuntu 18.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 18.04 VM
Canonical, the developer of Ubuntu, implemented the use of Netplan for easy-to-use network configuration as of version 17.x.
To configure the network interface, open the
01-netcfg.yaml file using the following command:
$ sudo vim /etc/netplan/01-netcfg.yaml
Edit the file to make it appear as follows:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network: version: 2 renderer: networkd ethernets: ens160: dhcp4: no dhcp6: no addresses: [x.x.x.x/32] gateway4: y.y.y.254 nameservers: addresses: [126.96.36.199,188.8.131.52] routes: - to: y.y.y.254/32 via: 0.0.0.0 scope: link
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 "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 "addresses", replace "x.x.x.x/32" with the Failover IP to which you have added the vMAC in the OVHcloud Manager plus the subnet you wish to use in CIDR notation.
- 3. Next to "gateway4", replace the "y.y.y." 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 184.108.40.206, you would use 220.127.116.11 as your gateway.
- 4. The DNS name server addresses listed are from OpenDNS. Feel free to use other name servers here, if you choose.
- 5. In the "routes" section, the y's correspond with your gateway IP address. Fill in these octets accordingly.
Now apply the Netplan settings with the following command:
$ sudo netplan apply
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 18.04 VM.