Centos 7 failover ip ovh example

This tutorial will show you how to setup a failover ip for ovh for centos 7. It requires a different configuration then centos v < 7. In this example i ll be using a proxmox server with an already configured vmbr0 configuration, where vmbr0 is bridging eth0. We then configure a KVM’s network inside the KVM, to allow it using the host’s vmbr0.

tutorial

1.) Get a mac for your failover ip @ ovh

Head to https://ovh.com/manager/ and create a mac address for a failover ip, then go inside proxmox’s network config and set the proxmox network card to match that mac address. Lets say you have the failover ip 1.1.1.1 and your proxmox server’s main ip is 151.1.1.151. When I recieved the failover ips i got an email which included the gateway¬† for this tutorial lets pick 151.13.37.254 as that gateway ( for the failover ips ).

 

2.) Fire up a kvm

inside the kvm cd to /etc/sysconfig/network-scripts/. Now enter:

Code:
ip addr

this will list you all interfaces attached to the kvm. note done the name in this example we will be using the name ens18. This means we have to create 2 files the ifcfg-ens18 and the route-ens18. You can also verify that the mac address is set properly here.

 

3.) Configure your network

Code:
nano /etc/sysconfig/network-scripts/ifcfg-ens18

DEVICE=ens18
HWADDR=00:11:22:33:44:55
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
USERCTL=none
PEERDNS=yes
IPADDR=1.1.1.1
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.255
GATEWAY=151.13.37.254

4.) Configure the route

Code:
nano /etc/sysconfig/network-scripts/route-ens18

151.13.37.254 – 255.255.255.255 ens18
151.80.20.0 – 151.13.37.254 255.255.255.0 ens18
default 151.13.37.254

151.13.37.254 is the gateway of our failover ips

151.1.1.151 is the main ip of our server

151.1.1.0 is the resulting network of our main ip

ens18 is the name of our network interface

 

5.) Restart networking

Code:
/etc/init.d/network restart

 

6.) Verify

Code:
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
inet 1.1.1.1/32 brd 1.1.1.1 scope global ens18
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe01:f4be/64 scope link
valid_lft forever preferred_lft forever

2 Comments

  1. ToKi December 1, 2016
    • loeken January 17, 2017

Leave a Reply

Your email address will not be published.

Powered by themekiller.com