Network Bridge using Netplan (Ubuntu)
A bridge created by a netplan file will persist after reboot. A basic Ubuntu install creates a netplan file at /etc/netplan/00-installer-config.yaml. This file can be edited to add the br0External bridge.
- Edit netplan
sudo nano /etc/netplan/00-installer-config.yaml
- Check for errors
sudo netplan generate
- Apply netplan
sudo netplan apply
- Example netplan which creates a bridge using the eno1 device.
network:
ethernets:
eno1:
dhcp4: false
bridges:
br0External:
interfaces:
- eno1
version: 2
- Example netplan which creates a bridge using the eno1 device and configures the bridge via DHCP.
network:
ethernets:
eno1:
dhcp4: false
bridges:
br0External:
interfaces:
- eno1
dhcp4: true
version: 2
- Example netplan which creates a bridge using the enp81s0f0 device and configures the bridge with an IP address, nameserver, and a default route:
network:
ethernets:
enp81s0f0:
dhcp4: false
bridges:
br0External:
interfaces:
- enp81s0f0
addresses:
- 192.168.1.2/16
nameservers:
addresses:
- 192.168.1.1
routes:
- to: default
via: 192.168.1.1
dhcp4: false
dhcp6: false
version: 2