systemd-networkd does not configure DHCPv4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan.io (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Invalid
|
Critical
|
Unassigned |
Bug Description
I have an up-to-date Ubuntu 18.04 (bionic) server installation (with systemd 237-3ubuntu10) which has following netplan configuration:
```
root@ubuntu:~# cat /etc/netplan/
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
all:
match: {}
dhcp4: yes
root@ubuntu:~# cat /run/systemd/
[Match]
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
```
Despite having DHCPv4 configured, no IPv4 address is configured on the ethernet device:
```
root@ubuntu:~# ip a show ens6
2: ens6: <BROADCAST,
link/ether 02:01:71:8f:cc:72 brd ff:ff:ff:ff:ff:ff
inet6 fe80::1:
valid_lft forever preferred_lft forever
```
The kernel dmesg has no related messages and the journal log also looks normal:
```
root@ubuntu:~# journalctl -u systemd-networkd
Jul 02 16:36:51 ubuntu systemd[1]: Starting Network Service...
Jul 02 16:36:51 ubuntu systemd-
Jul 02 16:36:51 ubuntu systemd-
Jul 02 16:36:51 ubuntu systemd[1]: Started Network Service.
Jul 02 16:36:51 ubuntu systemd-
Jul 02 16:36:51 ubuntu systemd-
```
Calling dhclient sets up the device correctly:
```
root@ubuntu:~# dhclient ens6
root@ubuntu:~# cat /var/lib/
lease {
interface "ens6";
fixed-address 87.106.172.36;
option subnet-mask 255.255.255.255;
option dhcp-lease-time 600;
option routers 87.106.172.1;
option dhcp-message-type 5;
option domain-name-servers 46.16.74.
option dhcp-server-
option interface-mtu 64000;
option host-name "ubuntu-
renew 1 2018/07/02 16:46:51;
rebind 1 2018/07/02 16:51:31;
expire 1 2018/07/02 16:52:46;
}
root@ubuntu:~# ip a show ens6
2: ens6: <BROADCAST,
link/ether 02:01:71:8f:cc:72 brd ff:ff:ff:ff:ff:ff
inet 87.106.172.36/32 brd 87.106.172.36 scope global ens6
valid_lft forever preferred_lft forever
inet6 fe80::1:
valid_lft forever preferred_lft forever
```
Changed in systemd (Ubuntu): | |
status: | New → Confirmed |
Changed in netplan.io (Ubuntu): | |
status: | New → Invalid |
Changed in systemd (Ubuntu): | |
assignee: | nobody → Dimitri John Ledkov 🌈 (xnox) |
Changed in systemd (Ubuntu): | |
assignee: | Dimitri John Ledkov (xnox) → nobody |
You can also reproduce this issue with the official cloud image. See https:/ /askubuntu. com/questions/ 1030081/ ubuntu- 18-04-cloud- image-does- not-get- dhcp-ipv4- address