With OVHcloud Failover IPs, connecting your virtual machines to the Internet can be a breeze. Follow this tutorial to configure networking on your CentOS 6.x 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 a CentOS 6.x VM
Configuring Network Settings in a CentOS 6.x VM
In this step, we will be configuring our interface settings. To do this, first navigate to the
network-scripts directory using the following command:
$ cd /etc/sysconfig/network-scripts
ls command to view the content of the directory.
$ ls -al
Locate your interface file (e.g. ifcfg-ethX) and then open it in a text editor of your choice using the following command:
Note: In our example the interface file is
$ sudo vi ifcfg-eth0
Edit the interfaces file to make it appear as follows:
HWADDR=*Verify this matches the vMAC created and assigned to the VM!*
UUID=*DO NOT edit this field!* ONBOOT=no
BOOTPROTO=dhcp IPADDR=x.x.x.x NETMASK=255.255.255.y GATEWAY=z.z.z.254 DNS1=188.8.131.52 DNS2=184.108.40.206
In this file, check/replace/add the following pieces of information as instructed:
- "ONBOOT" is set to "yes"
- "BOOTPROTO" is set to "none"
- "IPADDR", replace "x.x.x.x" with the Failover IP that you added a vMAC to in the OVHcloud Manager
- "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 /28 block, put "240" in the last octet.
- "GATEWAY", replace the "z.z.z.254" with the first three octets of your Dedicated server's IP address with a final octet of "254". For instance, if your Dedicated server's IP was 220.127.116.11, you would use 18.104.22.168 as your gateway.
Note: The DNS name servers listed are from OpenDNS. Feel free to use whichever name servers you prefer.
Next, create a new file,
route-eth0, in the
/etc/sysconfig/network-scripts/ directory and define the following default routes for the interface:
$ sudo vi /etc/sysconfig/network-scripts/route-eth0
z.z.z.254 dev eth0 default via z.z.z.254 dev eth0
Lastly, enable the NIC by restarting the network service:
$ sudo /etc/init.d/network restart
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 a CentOS 6.x VM.