netplan is the new default network configuration system for Ubuntu 17.10 (Artful) and onwards. It replaces /etc/network/interfaces.
The YAML configuration files are quite a lot nicer but there are a couple of bugs being worked out.
One quirk I discovered is that some settings - e.g. MTU - don't work if you're working with renamed interfaces when you match by name. For example, in an Artful VM with some added network interfaces, this doesn't work:
network:
version: 2
ethernets:
switchdevs:
match:
name: ens[78]
mtu: 1280
bridges:
br0:
interfaces: [switchdevs]
addresses:
- 10.10.10.2/24
This is tracked in LP#1724895.
The workaround at the moment is to specify the devices with something other than name, for example MAC address:
network:
version: 2
ethernets:
ens7:
match:
macaddress: 52:54:00:e2:29:24
mtu: 1280
ens8:
match:
macaddress: 52:54:00:63:33:e3
mtu: 1280
bridges:
br0:
interfaces: [ens7, ens8]
addresses:
- 10.10.10.2/24
If you apply this with a reboot, everything works:
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:f2:4b:48 brd ff:ff:ff:ff:ff:ff
3: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e2:29:24 brd ff:ff:ff:ff:ff:ff
4: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:63:33:e3 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 8a:43:6e:24:d7:17 brd ff:ff:ff:ff:ff:ff
However, if you take a system without a bridge, and apply this with netplan generate and netplan apply, rather than rebooting, this renames the devices! ens7 and ens8 have now become eth0 and eth1!
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:f2:4b:48 brd ff:ff:ff:ff:ff:ff
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e2:29:24 brd ff:ff:ff:ff:ff:ff
6: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:63:33:e3 brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 8a:43:6e:24:d7:17 brd ff:ff:ff:ff:ff:ff
This is tracked by LP: #1753868 . So for the moment, check your yaml file with netplan generate and reboot for best results.
The YAML configuration files are quite a lot nicer but there are a couple of bugs being worked out.
One quirk I discovered is that some settings - e.g. MTU - don't work if you're working with renamed interfaces when you match by name. For example, in an Artful VM with some added network interfaces, this doesn't work:
network:
version: 2
ethernets:
switchdevs:
match:
name: ens[78]
mtu: 1280
bridges:
br0:
interfaces: [switchdevs]
addresses:
- 10.10.10.2/24
This creates the bridge, but the MTUs are unchanged:
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:f2:4b:48 brd ff:ff:ff:ff:ff:ff
3: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e2:29:24 brd ff:ff:ff:ff:ff:ff
4: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:63:33:e3 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 8a:43:6e:24:d7:17 brd ff:ff:ff:ff:ff:ff
This is tracked in LP#1724895.
The workaround at the moment is to specify the devices with something other than name, for example MAC address:
network:
version: 2
ethernets:
ens7:
match:
macaddress: 52:54:00:e2:29:24
mtu: 1280
ens8:
match:
macaddress: 52:54:00:63:33:e3
mtu: 1280
bridges:
br0:
interfaces: [ens7, ens8]
addresses:
- 10.10.10.2/24
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:f2:4b:48 brd ff:ff:ff:ff:ff:ff
3: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e2:29:24 brd ff:ff:ff:ff:ff:ff
4: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:63:33:e3 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 8a:43:6e:24:d7:17 brd ff:ff:ff:ff:ff:ff
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:f2:4b:48 brd ff:ff:ff:ff:ff:ff
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e2:29:24 brd ff:ff:ff:ff:ff:ff
6: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:63:33:e3 brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 8a:43:6e:24:d7:17 brd ff:ff:ff:ff:ff:ff
This is tracked by LP: #1753868 . So for the moment, check your yaml file with netplan generate and reboot for best results.
Comments
Post a Comment