Debian 9 OVH Bridge Network Configuration

When you run VPS on OVH network behind bridge network, you need to create VMAC for each IP and assign to your network card.

Once this is done, you need to use following network configuration in your /etc/network/inferfaces file.

auto lo ens18
iface lo inet loopback
auto ens18
iface ens18 inet static
    address FAILOVER_IP
    netmask 255.255.255.255
    broadcast FAILOVER_IP
    post-up ip route add GATEWAY_IP dev ens18
    post-up ip route add default via GATEWAY_IP dev ens18
    pre-down ip route del GATEWAY_IP dev ens18
    pre-down ip route del default via GATEWAY_IP dev ens18

FAILOVER_IP = the IP you will be using for the virual machine.

GATEWAY_IP = IP of the Host server with last digits replaced by 254. If your servers main IP is XX.YY.ZZ.100, then Your GATEWAY_IP is XX.YY.ZZ.254

Here is an example config file i use in one of my VPS

auto ens18
iface ens18 inet static
    address 198.50.234.186
    netmask 255.255.255.255
    broadcast 198.50.234.186
    dns-nameservers 8.8.8.8 8.8.4.4
    post-up ip route add 158.69.124.254 dev ens18
    post-up ip route add default via 158.69.124.254 dev ens18
    pre-down ip route delete 158.69.124.254 dev ens18
    pre-down ip route delete default via 158.69.124.254 dev ens18

I made a pull request to OVH as OVH documentation use route command, that is deprecated in Debian 9 and Ubuntu 18.04. We need to use “ip route” command instead of “route” command.

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *