Netplan is based on YAML based configuration system that makes configuration process very simple.
Netplan has replaced the old configuration file /etc/network/interfaces that we previously used for configuring network interfaces in Ubuntu.
Netplan configuration files are at /etc/netplan/*.yaml.
NOTE: If you have multiple interfaces, use 02-network-manager-all.yaml for the second interface.
Netplan applies the configuration in the numerical order; i.e. the 01 file will be applied before the 02 file.
ip a
returns:
... enp3s0 ...
NOTE: Note the interface name that you want to configure using Netplan.
Edit the netplan file.
# Let NetworkManager manage all devices on this system #network: # version: 2 # renderer: NetworkManager network: version: 2 #renderer: NetworkManager renderer: networkd ethernets: enp3s0: dhcp4: no # disable existing configuration for ethernet #addresses: [192.168.1.69/24] #gateway4: 192.168.1.1 #nameservers: #addresses: [192.168.1.1] dhcp6: no # add configuration for bridge interface bridges: br0: interfaces: [enp3s0] dhcp4: no addresses: [192.168.1.69/24] gateway4: 192.168.1.1 nameservers: addresses: [192.168.1.1] #addresses: [192.168.1.26,192.168.1.2,192.168.1.25,192.168.1.1,1.1.1.1] parameters: # stp: false stp: true forward-delay: 4 dhcp6: no
NOTE:
Before applying any changes, test the configuration file:
sudo netplan try
sudo netplan apply
NOTE: In case you see any error, try debugging to investigate the problem.
To run debug:
sudo netplan –d apply
sudo systemctl restart network-manager
sudo systemctl restart system-networkd
ip a