OVH Bridge Networking
Setting up Bridge
- Debian 11.x / 12.x
- RHEL 9
- Ubuntu 22.04 / 24.04
OVH is now providing IPv6 as default on their servers and IPv4 is being provided via DHCP at the time of writing this documentation.
This is how your network config might look like on OVH after setting up Debian 12.x
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
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
With the above config in place, let's make the following changes, and then do a netplan apply
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
eno1:
accept-ra: false
match:
macaddress: 00:25:90:dd:be:7c
set-name: eno1
bridges:
virbr0:
interfaces: [eno1]
dhcp4: true
addresses:
- 2001:41d0:303:9a3b::1/128
routes:
- to: 2001:41d0:303:9aff:ff:ff:ff:ff/128
via: '::'
parameters:
stp: false
forward-delay: 0
As you can see running the command nmcli connection show
will show you the interfaces present on your system.
Consider the ones in green highlight, to be active connection, in our case it would be System eno1
.
[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
eth0 1271bb7a-0af0-4a56-a96a-3f2587340954 ethernet --
We will now run the following commands to create the bridge:
nmcli connection add type bridge con-name virbr0 ifname virbr0
nmcli connection modify virbr0 ipv4.addresses '51.83.4.59/32' ipv4.gateway '51.83.4.254' ipv4.dns '8.8.8.8' ipv4.method manual
nmcli connection modify 'System eno1' master virbr0
nmcli connection modify virbr0 connection.autoconnect-slaves 1
nmcli connection modify virbr0 ethernet.cloned-mac-address 00:25:90:DD:BE:7C
nmcli connection up virbr0 && nmcli connection up 'System eno1'
For the mac address we will use the following command
[root@ns3153458 ~]$ nmcli connection show "System eno1" | grep mac-address
802-3-ethernet.mac-address: 00:25:90:DD:BE:7C
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-denylist: --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
The following configuration will be present in the /etc/netplan/50-cloud-init.yaml
file.
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"
Then the following changes will be performed in the configuration:
network:
version: 2
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:0303:9aff:00ff:00ff:00ff:00ff"
on-link: true
Now we can apply our network settings using the following command:
netplan apply
After your purchase of additional subnets, it is mandatory to ensure you generate a virtual mac for each IP, you can choose VMware option and give it any name.
Please note, if you want to use more than 1 IP on a single VM, you need to ensure both IP(s) have the same mac, or else it will not work