Skip to main content

OVH Bridge Networking

OVH-specific facts

These apply to every example below:

  • Bridge name: br0. Avoid virbr0, which libvirt's default network already uses.
  • IPv4 is /32. OVH gives you a single IPv4 inside a /24, but the host owns just one address. Configure it as /32 with an on-link: true route to the gateway. Using /24 makes the kernel believe other addresses in the block are LAN neighbors when they are not.
  • IPv4 gateway = .254 of the /24. So for 51.83.4.59 the gateway is 51.83.4.254.
  • IPv6 prefix is /128 per host inside a /64 that is routed to the server. The gateway is the same /64 prefix with the last five blocks replaced by ff: for 2001:41d0:303:9a3b::1 the gateway is 2001:41d0:303:9aff:ff:ff:ff:ff. The address is outside the /128, so the IPv6 default route also uses on-link: true.
  • Virtual MACs. Each additional IP assigned to a guest VM needs a virtual MAC generated in the OVH control panel (pick "vmware", any name). The guest's NIC must use that MAC, otherwise OVH filters the traffic.
  • Same MAC for multiple IPs on one VM. If a single VM owns more than one OVH IP, every one of those IPs must be tied to the same virtual MAC in the OVH panel.
  • Avoid 8.8.8.8 for DNS in production. OVH recommends their resolvers: 213.186.33.99 (IPv4) and 2001:41d0:3:163::1 (IPv6).
  • Interface name in examples (eno1) is illustrative. Replace with your real default interface from ip route | grep default.

Bridge Mode

warning

OVH typically provides IPv6 as a routed /64 and IPv4 via DHCP at first boot. The cloud-init defaults look like this after a fresh Debian install:

# /etc/netplan/50-cloud-init.yaml (generated by cloud-init)
network:
version: 2
ethernets:
eno1:
accept-ra: false
addresses:
- 2001:41d0:303:9a3b::1/128
dhcp4: true
gateway6: 2001:41d0:303:9aff:ff:ff:ff:ff
match:
macaddress: 00:25:90:dd:be:7c
routes:
- to: 2001:41d0:303:9aff:ff:ff:ff:ff/128
via: '::'
set-name: eno1

Replace it with the bridged configuration below, then netplan apply:

# /etc/netplan/50-cloud-init.yaml
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
optional: true
match:
macaddress: 00:25:90:dd:be:7c
set-name: eno1
bridges:
br0:
interfaces: [eno1]
macaddress: 00:25:90:dd:be:7c
addresses:
- 51.83.4.59/32
- 2001:41d0:303:9a3b::1/128
routes:
- to: 0.0.0.0/0
via: 51.83.4.254
on-link: true
- to: "::/0"
via: "2001:41d0:303:9aff:ff:ff:ff:ff"
on-link: true
nameservers:
addresses: [213.186.33.99, 2001:41d0:3:163::1]
parameters:
stp: false
forward-delay: 0
info

After your purchase of additional IPs, generate a virtual MAC for each IP from the OVH control panel (pick the "vmware" option, any name).

warning

If you want to attach more than one OVH IP to a single VM, every IP must be tied to the same virtual MAC in the OVH panel. Different MACs on the same VM will fail.