Netplan ignores Interfaces without IP Addresses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned | ||
neutron |
Invalid
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Critical
|
Mathieu Trudel-Lapierre | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Netplan users who need to bring up an interface (set its flag to IFF_UP) but not define an address, using the networkd renderer, as the interface may be further managed via another tool.
[Test case]
1) Install Ubuntu
2) Set up netplan; with the following different use cases:
== New VLAN ==
network:
version: 2
renderer: networkd
ethernets:
[... whatever is already configured for the system...]
vlans:
vlan100:
link: <the existing ethernet>
id: 100
== Bring up an existing secondary interface ==
network:
version: 2
renderer: networkd
ethernets:
eth0: {}
3) Verify that in both cases, the interface (ethernet or VLAN) is brought up and shows UP, LOWER_UP flags in the output of 'ip link'.
[Regression potential]
As this brings a behavior change in netplan where as soon as an interface is listed in the netplan YAML, it will be brought up, care should be taken with existing configurations that do work, if specific devices are listed but are not assigned an IP address, as they will be brought up by networkd. This is expected to be a limited number of cases already, and impact to network installations is minimal.
----
The "manual" method in /etc/network/
When configuring an Interface without an IP Address, netplan ignores the interface instead of bringing it up.
---
network:
version: 2
renderer: networkd
ethernets:
eth1: {}
Expected result from `netplan apply`: eth1 is brought up.
Actual result: eth1 is still down.
Similarly `netplan generate` does not generate any file in /run/systemd/
tags: | added: cpe-onsite |
tags: | added: canonical-bootstack |
tags: | added: id-5cbf14f084a6534ff8ad8ae1 |
description: | updated |
no longer affects: | kolla |
Changed in netplan: | |
status: | Fix Committed → Fix Released |
Indeed; but this is meant to be that way -- there is no usefulness in having a network device listed in the file without any configuration, as you can always just do "ip link set $device up" to bring it up.
If there is no configuration, the device is left alone, as it should be.
If you must have an interface brought up but with no addresses, you may wish to also set:
dhcp4: off
dhcp6: off
These should force netplan to write out extra systemd configuration to disable DHCP, the new files present for systemd may help bringing up the interface.