Set OVH failover ip on a container with Netplan


I’m fairly new to networking and LXD in general and I was trying to set a OVH failover ip to a container.
I was following this thread : link

Basically, when I use this command (from this comment) ip -4 addr add dev eth0 PUBLIC-IP/32 preferred_lft 0, it works just fine. However, I did understand that this method isn’t persistent.

So here’s my question: how do I make it persistent using Netplan ? I tried this, but it didn’t work:

 version: 2
    dhcp4: no
    dhcp6: no
    addresses: [ip_failover/32]
    gateway4: host_gateway
     search: []
     addresses: []

Using the host ip with the last byte as .254 ( as the host_gateway

So yeah, how could I assign the failover ip ?
Thank you


Please use this guide from Simos:

Generate a virtual MAC Address (Control Panel SoYouStart/OVH/Kimsufi.) and assign it to the container:
lxc config set CTNAME volatile.eth0.hwaddr MACADRESSHERE

And done.

Thank you, it worked.

Here’s something I changed tho to make it work:

Basically, in the netplan configuration, I added, at the end:

    - to:
      via: gateway
      on-link: true

Again, thank you for your help !

1 Like

Or just ditch netplan, its awful, and install ifupdown2. Requires a “netcfg/do_not_use_netplan=true” flag in /etc/default/grub