[Bug 1779721] Re: systemd-networkd does not configure DHCPv4
Benjamin Drung
bdrung at posteo.de
Tue Jul 3 09:08:20 UTC 2018
My interpretation of the documentation was that an empty match entry
matches everything. I changed the configuration to enforce the matching
and it still fails:
```
root at ubuntu:~# cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
all:
match:
name: ens*
dhcp4: yes
root at ubuntu:~# networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 ens6 ether degraded configuring
2 links listed.
root at ubuntu:~# networkctl status ens6
* 2: ens6
Link File: /lib/systemd/network/99-default.link
Network File: /run/systemd/network/10-netplan-all.network
Type: ether
State: degraded (configuring)
Path: pci-0000:00:06.0
Driver: virtio_net
Vendor: Red Hat, Inc.
Model: Virtio network device
HW Address: 02:01:71:8f:cc:72
Address: fe80::1:71ff:fe8f:cc72
root at ubuntu:~# cat /run/systemd/network/10-netplan-all.network
[Match]
Name=ens*
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
root at ubuntu:~# journalctl -u systemd-networkd
Jul 03 08:52:33 ubuntu systemd[1]: Starting Network Service...
Jul 03 08:52:33 ubuntu systemd-networkd[447]: Enumeration completed
Jul 03 08:52:33 ubuntu systemd[1]: Started Network Service.
Jul 03 08:52:33 ubuntu systemd-networkd[447]: lo: Link is not managed by us
Jul 03 08:52:33 ubuntu systemd-networkd[447]: ens6: IPv6 successfully enabled
Jul 03 08:52:33 ubuntu systemd-networkd[447]: ens6: Gained carrier
Jul 03 08:52:35 ubuntu systemd-networkd[447]: ens6: Gained IPv6LL
```
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1779721
Title:
systemd-networkd does not configure DHCPv4
Status in netplan.io package in Ubuntu:
New
Status in systemd package in Ubuntu:
New
Bug description:
I have an up-to-date Ubuntu 18.04 (bionic) server installation (with
systemd 237-3ubuntu10) which has following netplan configuration:
```
root at ubuntu:~# cat /etc/netplan/01-netcfg.yaml
# 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 at ubuntu:~# cat /run/systemd/network/10-netplan-all.network
[Match]
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
```
Despite having DHCPv4 configured, no IPv4 address is configured on the
ethernet device:
```
root at ubuntu:~# ip a show ens6
2: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 64000 qdisc fq_codel state UP group default qlen 1000
link/ether 02:01:71:8f:cc:72 brd ff:ff:ff:ff:ff:ff
inet6 fe80::1:71ff:fe8f:cc72/64 scope link
valid_lft forever preferred_lft forever
```
The kernel dmesg has no related messages and the journal log also
looks normal:
```
root at ubuntu:~# journalctl -u systemd-networkd
Jul 02 16:36:51 ubuntu systemd[1]: Starting Network Service...
Jul 02 16:36:51 ubuntu systemd-networkd[1790]: ens6: Gained IPv6LL
Jul 02 16:36:51 ubuntu systemd-networkd[1790]: Enumeration completed
Jul 02 16:36:51 ubuntu systemd[1]: Started Network Service.
Jul 02 16:36:51 ubuntu systemd-networkd[1790]: lo: Link is not managed by us
Jul 02 16:36:51 ubuntu systemd-networkd[1790]: lo: Configured
```
Calling dhclient sets up the device correctly:
```
root at ubuntu:~# dhclient ens6
root at ubuntu:~# cat /var/lib/dhcp/dhclient.leases
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.70,46.16.72.37;
option dhcp-server-identifier 87.106.172.1;
option interface-mtu 64000;
option host-name "ubuntu-18_04-fkb-2018-07-02";
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 at ubuntu:~# ip a show ens6
2: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 64000 qdisc fq_codel state UP group default qlen 1000
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:71ff:fe8f:cc72/64 scope link
valid_lft forever preferred_lft forever
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1779721/+subscriptions
More information about the foundations-bugs
mailing list