With OVH US Failover IPs, connecting your virtual machines to the Internet can be a breeze. Follow this tutorial to connect your CentOS 7 (or Fedora-based equivalent) VM to the Internet.
- Creating a Virtual MAC for a Failover IP in the OVH US Manager
- Adding a Virtual MAC to the Virtual Machine's NIC in ESXi
- Configuring Network Settings in the Virtual Machine
- Failover IP through OVH US
- Dedicated Server running VMware ESXi 6.5
- Bootable VM in VMware ESXi 6.5 running a Fedora-Based OS
Step One: Creating a Virtual MAC for a Failover IP in the OVH US Manager
In this section, we will be creating a vMAC (Virtual MAC Address) to be used by the NIC (Network Interface Card) which ESXi assigns to your VM. To begin, log in to the OVH US Manager. On the left-hand sidebar click the IP option.
Choose the Failover IP you wish to configure to your VM and click the ellipses (...) next to it. Then, select Add a virtual MAC from the drop-down menu.
In the popup menu, change the "Type" to "vmware" and enter the name of your virtual machine.
Step Two: Adding a Virtual MAC to the Virtual Machine's NIC in ESXi
In this step, we will be pairing the vMAC, which we generated in Step One, to the interface that ESXi has assigned to the VM. To complete this step, your VM must be powered off.
In ESXi, right-click your VM and select Edit settings from the drop-down menu.
Next, select the drop-down next to "Network Adapter 1" and change the "MAC Address" field to Manual. Enter the vMAC created in the OVH US Manager into the "Network Adapter" field.
Step Three: Configuring Network Settings in the Virtual Machine
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-ensXXX) and then open it using the following command:
Note: In our example the interface file is
$ sudo vi ifcfg-ens192
Edit the interfaces file to make it appear as follows:
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens192 UUID=*DO NOT edit this field!* DEVICE=ens192 ONBOOT=no IPADDR=x.x.x.x NETMASK=255.255.255.y GATEWAY=z.z.z.254 DNS1=220.127.116.11 DNS2=18.104.22.168
In this file, check/replace/add the following pieces of information as instructed:
- "BOOTPROTO" is set to "none"
- "ONBOOT" is set to "yes"
- "IPADDR", replace "x.x.x.x" with the Failover IP that you added a vMAC to in the OVH US 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 22.214.171.124, you would use 126.96.36.199 as your gateway.
Note: The DNS name servers listed are from OpenDNS. Feel free to use whichever name servers you prefer.
Next, enable the NIC by restarting the network service:
$ sudo systemctl restart network
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.
Connecting your VM to the Internet is an essential task before it can be used as a web server, a mail server, or whatever other use you have in mind. Having read this article, you should be familiar with the steps that are required to connect a CentOS 7 (or Fedora-based equivalent) VM to the Internet using VMware ESXi 6.5.