<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemd-networkd does not renew DHCP lease when it expires"
href="https://bugs.freedesktop.org/show_bug.cgi?id=82731">82731</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>systemd-networkd does not renew DHCP lease when it expires
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>major
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gt6@gmx.net
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre>I've sent an email with this problem to the systemd-devel mailing list weeks
ago (<a href="http://lists.freedesktop.org/archives/systemd-devel/2014-July/021602.html">http://lists.freedesktop.org/archives/systemd-devel/2014-July/021602.html</a>)
and never received any feedback, so I'm just going to assume that this is
indeed a bug. I'll reproduce what I've said in that email.
I run an Archlinux home server connected to a netgear home router. I use
a bridge because among other things, the server does KVM virtualization.
My problem is that once the DHCP lease on br0 expires, it is not renewed.
Here's `ip a` before and after br0 loses the ip. You can see the
"valid_lft 42sec" just before the IP is lost. The lease appears to be
valid for 24 hours.
-------------before---------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
master br0 state UP group default qlen 1000
link/ether bc:5f:f4:90:23:85 brd ff:ff:ff:ff:ff:ff
inet6 fe80::be5f:f4ff:fe90:2385/64 scope link
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP group default
link/ether b6:29:d8:20:20:11 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.33/24 brd 192.168.1.255 scope global dynamic br0
valid_lft 42sec preferred_lft 42sec
inet6 fe80::b429:d8ff:fe20:2011/64 scope link
valid_lft forever preferred_lft forever
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
master br0 state UNKNOWN group default qlen 500
link/ether fe:54:00:55:09:68 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe55:968/64 scope link
valid_lft forever preferred_lft forever
-------------after---------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
master br0 state UP group default qlen 1000
link/ether bc:5f:f4:90:23:85 brd ff:ff:ff:ff:ff:ff
inet6 fe80::be5f:f4ff:fe90:2385/64 scope link
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UP group default
link/ether b6:29:d8:20:20:11 brd ff:ff:ff:ff:ff:ff
inet6 fe80::b429:d8ff:fe20:2011/64 scope link
valid_lft forever preferred_lft forever
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
master br0 state UNKNOWN group default qlen 500
link/ether fe:54:00:55:09:68 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe55:968/64 scope link
valid_lft forever preferred_lft forever
----------------------------------
Below are the relevant configs.
/etc/systemd/network/bridge-data.netdev:
----------------------------------
[NetDev]
Name=br0
Kind=bridge
----------------------------------
/etc/systemd/network/bridge-data.network:
----------------------------------
[Match]
Name=br0
[Network]
DHCP=yes
----------------------------------
/etc/systemd/network/enterprise.network:
----------------------------------
[Match]
Name=en*
[Network]
Bridge=br0
----------------------------------
I've enabled DEBUG logging for systemd-networkd, but it's not giving me
anything useful. Here's what I see at the moment the IP is lost (at
17:44:49) with some context:
----------------------------------
Jul 23 17:39:02 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Next
retransmission in 1min 48.764460s
Jul 23 17:40:51 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 23 17:40:51 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Next
retransmission in 1min 55.518924s
Jul 23 17:42:47 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 23 17:42:47 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Next
retransmission in 2min 4.769016s
Jul 23 17:44:49 enterprise systemd-networkd[25474]: br0 :
removed address: 192.168.1.33/24
Jul 23 17:44:52 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 23 17:44:52 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Next
retransmission in 1min 51.959760s
Jul 23 17:46:44 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 23 17:46:44 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Next
retransmission in 2min 5.687352s
Jul 23 17:48:49 enterprise systemd-networkd[25474]: DHCPv6 CLIENT: Sent
SOLICIT
----------------------------------
As you can see, it just says "br0: removed address:" and that's it.
Every now and then (less than once a day) there will be something like this:
----------------------------------
Jul 25 10:11:25 enterprise systemd-networkd[19106]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 25 10:11:25 enterprise systemd-networkd[19106]: DHCPv6 CLIENT: Next
retransmission in 1min 57.978432s
Jul 25 10:12:31 enterprise systemd-networkd[19106]: DHCP CLIENT
(0x461b140f): REQUEST (rebinding)
Jul 25 10:12:31 enterprise systemd-networkd[19106]: DHCP CLIENT
(0x461b140f): NAK
Jul 25 10:12:31 enterprise systemd-networkd[19106]: DHCP CLIENT
(0x461b140f): STOPPED: No lease
Jul 25 10:12:31 enterprise systemd-networkd[19106]: br0 : IP
address in use.
Jul 25 10:13:23 enterprise systemd-networkd[19106]: DHCPv6 CLIENT: Sent
SOLICIT
Jul 25 10:13:23 enterprise systemd-networkd[19106]: DHCPv6 CLIENT: Next
retransmission in 2min 1.184604s
----------------------------------
but it doesn't seem to have any negative effect and it's probably
unrelated to the problem.
I also don't see anything in dmesg. Other machines on the network are
unaffected so I doubt it has anything to do with the router.
It's a Realtek onboard RTL8111/8168/8411 adaptor and Linux uses the
r8169 driver automatically. I'm aware that there's a dedicated r8168
driver by realtek, but I'm using the same mainboard (same revision) with
Arch in another machine (without a bridge) and I never had any problems.
Hence, I doubt that the r8169 driver is the problem but I will try using
it on occasion. (You can imagine that debugging this problem is a pain
because I always have to wait 24h to see if a change had any effect...)
This is systemd 215 built on Jul. 8.
For now, I've enabled a cron job that checks if the lease is about to expire
within the next 1h and restarts systemd-networkd if necessary, but that's just
silly.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>