[SOLVED] Proxmox VE 6 - OVH - IP failover

frmiqueias

New Member
Aug 5, 2021
8
0
1
32
Brazil
miqueiasfrancisco.com.br
I'm sharing the way what I used to bring a VM online using OVH's IP failover.

I hope it helps someone who is going through the same difficulties I encountered.

DEFINITIONS

ens3f0
= Main network interface in proxmox
51.xxx.xxx.xxx = Main IP PROXMOX server
51.xxx.xxx.254 = Your gateway, in OVH uses the server's main IP replacing the last digits by 254
158.xx.xxx.xx/29 = Your IP FAILOVER range at OVH
158.xx.xxx.23 = VM IP of the FAILOVER range above, the IP must not be the first or the last of the range

Before starting, create a virtual MAC address on the OVH panel, do not use the first and last IP of your FAILOVER IP range.
To create the virtual MAC use the following tutorial: https://docs.ovh.com/gb/en/dedicated/network-bridging/


Code:
# /etc/sysctl.conf

Change to:
Code:
net.ipv4.ip_forward=1

Code:
# sysctl -p

Code:
# cat /etc/network/interfaces

Your /etc/network/interfaces file should look like this:

Code:
auto lo
iface lo inet loopback

auto ens3f0
iface ens3f0 inet manual

iface ens13f0 inet manual

iface ens13f1 inet manual

iface ens3f1 inet manual

iface enp0s20f0u2u2c2 inet manual

auto vmbr0
iface vmbr0 inet manual
        bridge-ports ens3f0
        bridge-stp off
        bridge-fd 0
        address 51.xxx.xxx.xxx/24
        gateway 51.xxx.xxx.254

auto vmbr1
iface vmbr1 inet static
        address 158.xx.xxx.xx/29
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr1/proxy_arp

IMPORTANT

For IP FAILOVER it is essential that bridge-ports has the value none, you must not set a bridge port, this way it is as if your VM were directly connected to the OVH network.

SETTING VM CENTOS 7

First step disable NetworkManager

Code:
# systemctl stop NetworkManager.service
Code:
# systemctl disable NetworkManager.service
Code:
# systemctl restart network.service
Code:
# systemctl enable network.service


Setting routes

File /etc/sysconfig/network-scripts/route-eth0 will only work if NetworkManger is disabled, make sure you have done the above step.

Code:
# nano /etc/sysconfig/network-scripts/route-eth0

Replace to:

Code:
51.xxx.xxx.254 dev eth0
default via 51.xxx.xxx.254 dev eth0


Setting network interface

Code:
# nano /etc/sysconfig/network-scripts/ifcfg-eth0

Must look like this:

Code:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=e1641beb-1xxxxxxxxxxxx   #UUID generated automatically
DEVICE=eth0
ONBOOT=yes
USERCTL=no
PEERDNS=no
NETMASK=255.255.255.255
IPADDR=158.xx.xxx.23
GATEWAY=51.xxx.xxx.254
ARP=yes
HWADDR=02:00:XXXXXXXX   #VIRTUAL MAC ADDRESS obtained from OVH
#
NM_CONTROLLED=no


Code:
# nano /etc/resolv.conf

insert this

Code:
nameserver 213.186.33.99


https://docs.ovh.com/gb/en/dedicated/network-bridging/
https://pve.proxmox.com/wiki/Network_Configuration
https://pve.proxmox.com/pve-docs/images/default-network-setup-routed.svg
 
Last edited:

lps90

Member
May 21, 2020
168
6
23
The thing is, why cant we use a private static ip that is assigned to the failover ip in centos 7? :(
example: 192.168.1.50
(with centos 8 it works...)
 

lps90

Member
May 21, 2020
168
6
23
**Btw, this configuration is probably only for proxmox 6, cause with proxmox 7 it i not working mate.

To work on Proxmox 7 you need to remove this part from /etc/network/interfaces:

auto vmbr1
iface vmbr1 inet static
address 158.xx.xxx.xx/29
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr1/proxy_arp

Then it will work...

Thanks anyway mate ;)
 
Last edited:

lps90

Member
May 21, 2020
168
6
23
I'm glad you got it! :)

well, no.. xD
Cause the goal is configuring the vm with static ip (associated with a failover ip), and thats not the case.
So basically this only works for those who only use failover ip, not for those wo want to use a static ip + failover ip with iptables rules :(

With centos 8 vm it works with no problems, but with centos 7 is not working at all.. (at least not in Proxmox 7).
 
Last edited:

jinjer

Active Member
Oct 4, 2010
203
6
38
Sorry guys to enter here to disturb, but that configuration above screams vengeance! It's overly complicated and unnecessary. I'll show an alternative configuration I think is cleaner and makes to easier transition from one ovh server to another. Here it goes:

1. The proxmox server only needs 1 vmbr interface for it's own address:
Code:
auto vmbr0
iface vmbr0 inet manual
        bridge-ports ens3f0
        bridge-stp off
        bridge-fd 0
        address 51.xxx.xxx.xxx/24
        gateway 51.xxx.xxx.254
2. The proxmox VM will be connected to this vmbr0 interface, but using it's own MAC address you generated as per instructions.
3. No need for proxy-arp and routing on vmbr1. Actually no need for routing on vmbr0 too as you're using the bridge only.
4. The VM (centos in this case) will just configure it's own interface from inside and add the dreaded default route as you already show.

The advantage here is that the proxmox server does not need to know anything about the IP of the guest. The only change is inside the guest to add the default gateway the way ovh wants it (and I might say WTF!... there must be an easier way).

Hope this is useful
 

stormy27

Member
Feb 28, 2019
9
0
6
Sorry guys to enter here to disturb, but that configuration above screams vengeance! It's overly complicated and unnecessary. I'll show an alternative configuration I think is cleaner and makes to easier transition from one ovh server to another. Here it goes:

1. The proxmox server only needs 1 vmbr interface for it's own address:
Code:
auto vmbr0
iface vmbr0 inet manual
        bridge-ports ens3f0
        bridge-stp off
        bridge-fd 0
        address 51.xxx.xxx.xxx/24
        gateway 51.xxx.xxx.254
2. The proxmox VM will be connected to this vmbr0 interface, but using it's own MAC address you generated as per instructions.
3. No need for proxy-arp and routing on vmbr1. Actually no need for routing on vmbr0 too as you're using the bridge only.
4. The VM (centos in this case) will just configure it's own interface from inside and add the dreaded default route as you already show.

The advantage here is that the proxmox server does not need to know anything about the IP of the guest. The only change is inside the guest to add the default gateway the way ovh wants it (and I might say WTF!... there must be an easier way).

Hope this is useful
@jinjer thanks that's really interesting!

I've opened another thread for a specific configuration, with PFSENSE inside.

Any tips @jinjer how to find a solution to this problem please???

https://forum.proxmox.com/threads/proxmox-7-ipfo-ovh-with-pfsense.105539/
 

Attachments

  • test.jpg
    test.jpg
    50 KB · Views: 20
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!