[systemd-devel] Bridge not picking up DHCP address

Mauricio Tavares raubvogel at gmail.com
Fri Aug 29 13:22:14 PDT 2014


      So I have a system 2 interfaces, each of them using dhcp in
different networks (both served by the same nameserver but in
different vlans). Let's begin by showing my config files:

core at coreos ~ $ more /etc/systemd/network/{10,16}-*
::::::::::::::
/etc/systemd/network/10-
bridge.netdev
::::::::::::::
[NetDev]
Name=br0
Kind=bridge
::::::::::::::
/etc/systemd/network/10-bridge.network
::::::::::::::
[Match]
Name=enp0s17

[Network]
Bridge=br0
::::::::::::::
/etc/systemd/network/16-internal.network
::::::::::::::
[Match]
Name=br0

[Network]
DHCP=yes

[DHCP]
UseHostname=false
UseRoutes=false
UseDNS=false
core at coreos ~ $  more /etc/systemd/network/15-management.network
[Match]
Name=enp0s18

[Network]
DHCP=yes

[DHCPv4]
UseHostname=false

core at coreos ~ $

As you can see, br0 is a bridge on the top of enp0s17. Only IP I am
seeing assigned is for enp0s18:

core at coreos ~ $ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master br0 state UNKNOWN qlen 1000
    link/ether 00:0c:29:2e:cf:e3 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe2e:cfe3/64 scope link
       valid_lft forever preferred_lft forever
3: enp0s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:2e:cf:ed brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.109/24 brd 192.168.4.255 scope global dynamic enp0s18
       valid_lft 5634sec preferred_lft 5634sec
    inet6 fe80::20c:29ff:fe2e:cfed/64 scope link
       valid_lft forever preferred_lft forever
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 1a:f3:7b:69:cb:54 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::18f3:7bff:fe69:cb54/64 scope link
       valid_lft forever preferred_lft forever
core at coreos ~ $

We can see my dhcp/dns server really wants to give the box an IP
(10.0.0.0/24) to br0:

Aug 29 09:38:18 venus dhcpd: DHCPDISCOVER from 1a:f3:7b:69:cb:54
(coreos) via eth0
Aug 29 09:38:18 venus dhcpd: DHCPOFFER on 10.0.0.104 to
1a:f3:7b:69:cb:54 (coreos) via eth0
Aug 29 09:38:18 venus dhcpd: DHCPDISCOVER from 00:0c:29:2e:cf:ed
(coreos) via 192.168.4.1
Aug 29 09:38:19 venus dhcpd: DHCPOFFER on 192.168.4.109 to
00:0c:29:2e:cf:ed (coreos) via 192.168.4.1
Aug 29 09:38:19 venus dhcpd: DHCPREQUEST for 192.168.4.109
(192.168.3.10) from 00:0c:29:2e:cf:ed (coreos) via 192.168.4.1
Aug 29 09:38:19 venus dhcpd: DHCPACK on 192.168.4.109 to
00:0c:29:2e:cf:ed (coreos) via 192.168.4.1
Aug 29 09:38:19 venus dhcpd: DHCPDISCOVER from 1a:f3:7b:69:cb:54
(coreos) via eth0
Aug 29 09:38:19 venus dhcpd: DHCPOFFER on 10.0.0.104 to
1a:f3:7b:69:cb:54 (coreos) via eth0
Aug 29 09:38:20 venus dhcpd: DHCPREQUEST for 192.168.4.109
(192.168.3.10) from 00:0c:29:2e:cf:ed (coreos) via 192.168.4.1
Aug 29 09:38:20 venus dhcpd: DHCPACK on 192.168.4.109 to
00:0c:29:2e:cf:ed (coreos) via 192.168.4.1

but that host is not taking it (no DHCPREQUEST nor DHCPACK) on the br0
interface (compare it to enp0s18, which does the entire DHCP dance).
Let's do some asking on the log file (after I restarted networkd in
hope I would get an IP in br0):

journalctl -u systemd-networkd:
Aug 29 13:30:59 coreos systemd[1]: Stopping Network Service...
Aug 29 13:30:59 coreos systemd[1]: Starting Network Service...
Aug 29 13:30:59 coreos systemd-networkd[827]: br0             : netdev ready
Aug 29 13:30:59 coreos systemd-networkd[827]: br0             : gained carrier
Aug 29 13:30:59 coreos systemd-networkd[827]: enp0s18         : gained carrier
Aug 29 13:30:59 coreos systemd-networkd[827]: enp0s17         : gained carrier
Aug 29 13:30:59 coreos systemd-networkd[827]: lo              : gained carrier
Aug 29 13:30:59 coreos systemd[1]: Started Network Service.
Aug 29 13:30:59 coreos systemd-networkd[827]: br0             : link configured
Aug 29 13:30:59 coreos systemd-networkd[827]: enp0s18         : link configured
Aug 29 13:30:59 coreos systemd-networkd[827]: lo              : link configured
Aug 29 13:30:59 coreos systemd-networkd[827]: enp0s17         : link configured
Aug 29 13:31:02 coreos systemd-networkd[827]: enp0s18         : DHCPv4
address 192.168.4.109/24 via 192.168.4.1
Aug 29 13:31:02 coreos systemd-networkd[827]: enp0s18         : link configured
(Time is UTC)

Once again, enp0s18 gets an IP. I do not know if the order shown in
journalctl is important but br0 is being mentioned way before enp0s17.
What am I doing wrong here?


More information about the systemd-devel mailing list