OVH Bridge Networking
OVH-specific facts
These apply to every example below:
- Bridge name:
br0. Avoidvirbr0, 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/32with anon-link: trueroute to the gateway. Using/24makes the kernel believe other addresses in the block are LAN neighbors when they are not. - IPv4 gateway =
.254of the /24. So for51.83.4.59the gateway is51.83.4.254. - IPv6 prefix is
/128per host inside a/64that is routed to the server. The gateway is the same/64prefix with the last five blocks replaced byff: for2001:41d0:303:9a3b::1the gateway is2001:41d0:303:9aff:ff:ff:ff:ff. The address is outside the/128, so the IPv6 default route also useson-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.8for DNS in production. OVH recommends their resolvers:213.186.33.99(IPv4) and2001:41d0:3:163::1(IPv6). - Interface name in examples (
eno1) is illustrative. Replace with your real default interface fromip route | grep default.
Bridge Mode
- Debian 11.x / 12.x / 13.x
- RHEL 9 / 10
- Ubuntu 22.04 / 24.04 / 26.04
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
nmcli connection show lists the active connections. Typical OVH output:
[root@ns3153458 ~]# nmcli connection show
NAME UUID TYPE DEVICE
System eno1 abf4c85b-57cc-4484-4fa9-b4a71689c359 ethernet eno1
lo ae2b2076-8188-4a8f-8f9b-8cdb57032dec loopback lo
Read the physical NIC's MAC, then create a bridge that clones it:
nmcli connection show "System eno1" | grep mac-address
802-3-ethernet.mac-address: 00:25:90:DD:BE:7C
nmcli connection add type bridge con-name br0 ifname br0
nmcli connection modify br0 ipv4.addresses '51.83.4.59/32' ipv4.gateway '51.83.4.254' ipv4.dns '213.186.33.99' ipv4.method manual
nmcli connection modify br0 +ipv4.routes '51.83.4.254/32'
nmcli connection modify br0 ipv6.addresses '2001:41d0:303:9a3b::1/128' ipv6.gateway '2001:41d0:303:9aff:ff:ff:ff:ff' ipv6.dns '2001:41d0:3:163::1' ipv6.method manual
nmcli connection modify br0 +ipv6.routes '2001:41d0:303:9aff:ff:ff:ff:ff/128'
nmcli connection modify 'System eno1' master br0
nmcli connection modify br0 connection.autoconnect-slaves 1
nmcli connection modify br0 ethernet.cloned-mac-address 00:25:90:DD:BE:7C
nmcli connection up br0 && nmcli connection up 'System eno1'
The extra +ipv4.routes and +ipv6.routes entries do the same job as netplan's on-link: true: they tell NetworkManager that the gateway is directly reachable even though it sits outside the host's prefix.
The default /etc/netplan/50-cloud-init.yaml after a fresh Ubuntu install on OVH:
network:
version: 2
ethernets:
eno1:
match:
macaddress: "00:25:90:dd:be:7c"
addresses:
- "2001:41d0:303:9a3b::1/128"
dhcp4: true
accept-ra: false
set-name: "eno1"
routes:
- on-link: true
to: "default"
via: "2001:41d0:303:9aff:ff:ff:ff:ff"
Replace it with the bridged version:
network:
version: 2
renderer: networkd
ethernets:
eno1:
match:
macaddress: 00:25:90:dd:be:7c
dhcp4: no
dhcp6: no
bridges:
br0:
macaddress: 00:25:90:dd:be:7c
interfaces:
- eno1
dhcp4: no
dhcp6: no
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
Apply with:
netplan apply
After your purchase of additional IPs, generate a virtual MAC for each IP from the OVH control panel (pick the "vmware" option, any name).
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.