I spend a bit of time debugging this with xnox. Here some of the
results:

# How to reproduce:
I setup a isc-dhcp-server with a fixed IP for my test rpi2 set to default/max 
lifetime of 120sec. The rpi2 was connected to the network with the 
isc-dhcp-server but unmodified otherwise. Once the pi2 connected and got an IP 
I switched the default IP to +1 and reloaded the isc-dhcp-server configuration. 
When the lease expired I could see the same as the OP - i.e. both IPs got 
removed.

# Related upstream bugs:
The patch from https://github.com/systemd/systemd/issues/5625 did not help with 
the issue

# Log
The full log of systemd-networkd is available here: 
http://paste.ubuntu.com/25686225/ - it was obtained by adding 
[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug for the systemd-networkd.service.

The relevant lines:

Mar 14 21:02:52 localhost.localdomain systemd-networkd[7660]: eth0: Adding 
address: 192.168.1.124/24 (valid for 2min)
Mar 14 21:02:52 localhost.localdomain systemd-networkd[7660]: Sent message 
type=signal sender=n/a destination=n/a 
object=/org/freedesktop/network1/link/_33 
interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=16 
reply_cookie=0 error=n/a
Mar 14 21:02:52 localhost.localdomain systemd-networkd[7660]: Sent message 
type=signal sender=n/a destination=n/a object=/org/freedesktop/network1 
interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=17 
reply_cookie=0 error=n/a
Mar 14 21:02:52 localhost.localdomain systemd-timesyncd[995]: Network 
configuration changed, trying to establish connection.
Mar 14 21:02:52 localhost.localdomain systemd[1]: Starting Update resolvconf 
for networkd DNS...
Mar 14 21:02:56 localhost.localdomain systemd-networkd[7660]: NDISC: Sent 
Router Solicitation
Mar 14 21:03:00 localhost.localdomain systemd-networkd[7660]: NDISC: Sent 
Router Solicitation
Mar 14 21:03:04 localhost.localdomain systemd-networkd[7660]: NDISC: Invoking 
callback for 't'.
Mar 14 21:03:22 localhost.localdomain systemd[1]: Started Update resolvconf for 
networkd DNS.
Mar 14 21:03:51 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x22f0fd4b): REQUEST (renewing)
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x22f0fd4b): REQUEST (rebinding)
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x22f0fd4b): NAK: requested address is incorrect
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): REBOOT in 0
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): DISCOVER
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): OFFER
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): REQUEST (requesting)
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): ACK
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): lease expires in 1min 57s
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): T2 expires in 1min 43s
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: DHCP CLIENT 
(0x4d15b90b): T1 expires in 1min
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: eth0: DHCPv4 
address 192.168.1.125/24
Mar 14 21:04:36 localhost.localdomain systemd-timesyncd[995]: Network 
configuration changed, trying to establish connection.
Mar 14 21:04:36 localhost.localdomain systemd-networkd[7660]: eth0: Updating 
address: 192.168.1.125/24 (valid for 2min)
Mar 14 21:04:36 localhost.localdomain systemd[1]: Starting Update resolvconf 
for networkd DNS...
Mar 14 21:04:52 localhost.localdomain systemd-networkd[7660]: eth0: Removing 
address: 192.168.1.125/24 (valid for 1min 44s)
Mar 14 21:04:52 localhost.localdomain systemd-networkd[7660]: eth0: Removing 
address: 192.168.1.124/24 (valid for 0)
Mar 14 21:04:52 localhost.localdomain systemd-networkd[7660]: Sent message 
type=signal sender=n/a destination=n/a 
object=/org/freedesktop/network1/link/_33 
interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=18 
reply_cookie=0 error=n/a
Mar 14 21:04:52 localhost.localdomain systemd-networkd[7660]: Sent message 
type=signal sender=n/a destination=n/a object=/org/freedesktop/network1 
interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=19 
reply_cookie=0 error=n/a
Mar 14 21:04:52 localhost.localdomain systemd-timesyncd[995]: Network 
configuration changed, trying to establish connection.
Mar 14 21:05:06 localhost.localdomain systemd[1]: Started Update resolvconf for 
networkd DNS.

** Bug watch added: github.com/systemd/systemd/issues #5625
   https://github.com/systemd/systemd/issues/5625

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1721223

Title:
  Networkd fail to set ip address between leases if ip address changes
  on UbuntuCore

Status in Snappy:
  New
Status in systemd package in Ubuntu:
  New
Status in systemd source package in Xenial:
  New

Bug description:
  Hi there, 
  we found a replicable issue that involves the Ubuntu Core networking and 
causes complete loss of connectivity. 
  We run a custom board with ubuntu core: the architecure is amrhf.
  We replicated this issue with an official Ubuntu Core image on a Raspberry 
Pi: other platform was been tested.
  It shows that it is a snap core problem which interests networkd: we use the 
default network stack based on networkd + netplan.

  Below steps to replicate the issue.

      1)Setup a dhcp server for lease of about some minutes (i.e 10 minutes).
      2)Boot the board and wait for get an ip from dhcp server
      3)Before the lease expires, set a reservation for a different ip address

  Depending on lease duration before the lease expires( for 10 minute we have 2 
minutes before ), networkd configure the new address in addition to the 
previous one.
  When the lease expire both ip address ( the prevoius and the new one ) 
disappear from the interested network interface.
  Depending on lease duration before the second lease expires ( for 10 minure 
we have 2 minutes before ) networkd configure only the new ip address on the 
network interface and the ping toward an outside host work properly.

  During the test the dhcp server records correctly leases and their
  duration.

  We check directly from console the network interface setting with the
  tool ip, checking continuously the value for ip address and valid_lft
  fields for the interested network interface.

  Please note that if the ip address setting are the same between leases
  the problem doesn’t jump out.

  Please note that if the ip address setting are different between lease
  the problem jumps out and it is very bad:

  Typically the lease time on consumer router are about some day, then a
  board that change ip between lease loses the network connectivity for
  some day without a direct action.

  Please, after a confirmation from your side of the issue, could you
  fix the problem or escalate the issue at the upstream project?

  We are available for further testing.

  Below syslog annotated with ip address state:

  
  Oct  4 09:48:06 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:49:36 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:49:25 localhost systemd-timesyncd[996]: Network configuration 
changed, trying to establish connection.
  Oct  4 09:49:26 localhost systemd-timesyncd[996]: Synchronized to time server 
91.189.89.199:123 (ntp.ubuntu.com).
  Oct  4 09:49:26 localhost systemd[1]: Starting Update resolvconf for networkd 
DNS...
  Oct  4 09:49:26 localhost systemd[1]: Started Update resolvconf for networkd 
DNS.
  Oct  4 09:49:37 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:51:07 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:51:09 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:52:39 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:52:40 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:54:10 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:54:11 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:55:41 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:54:23 localhost systemd-timesyncd[996]: Network configuration 
changed, trying to establish connection.
  Oct  4 09:54:23 localhost systemd[1]: Starting Update resolvconf for networkd 
DNS...
  Oct  4 09:54:23 localhost systemd-timesyncd[996]: Synchronized to time server 
91.189.89.199:123 (ntp.ubuntu.com).
  Oct  4 09:54:23 localhost systemd[1]: Started Update resolvconf for networkd 
DNS.
  Oct  4 09:55:43 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:57:13 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:57:14 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 09:58:44 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 09:58:46 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:00:16 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:00:17 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:01:47 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:01:48 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:03:18 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]

  Oct  4 10:03:05 localhost systemd-networkd[623]: eth0: DHCPv4 address
  192.168.5.124/24 via 192.168.5.1 -----> here begin two ip address
  state

  Oct  4 10:03:05 localhost systemd-timesyncd[996]: Network configuration 
changed, trying to establish connection.
  Oct  4 10:03:05 localhost systemd[1]: Starting Update resolvconf for networkd 
DNS...
  Oct  4 10:03:05 localhost systemd[1]: Started Update resolvconf for networkd 
DNS.
  Oct  4 10:03:15 localhost systemd-timesyncd[996]: Timed out waiting for reply 
from 91.189.89.199:123 (ntp.ubuntu.com).
  Oct  4 10:03:16 localhost systemd-timesyncd[996]: Synchronized to time server 
91.189.89.198:123 (ntp.ubuntu.com).
  Oct  4 10:03:20 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:04:50 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]

  Oct  4 10:04:23 localhost systemd-timesyncd[996]: Network
  configuration changed, trying to establish connection. ----> disappear
  any address

  Oct  4 10:04:23 localhost systemd[1]: Starting Update resolvconf for networkd 
DNS...
  Oct  4 10:04:23 localhost systemd[1]: Started Update resolvconf for networkd 
DNS.
  Oct  4 10:04:51 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:06:21 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:06:23 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:07:53 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:07:54 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:09:24 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:09:24 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:10:54 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:10:55 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 

  10:12:25 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ] ------>
  before this line interface eth0 don't have address, after this line
  the interfaces get 192.168.5.124/24( the second lise adddress)

  
  Oct  4 10:11:49 localhost systemd[1]: Starting Update resolvconf for networkd 
DNS...
  Oct  4 10:11:49 localhost systemd[1]: Started Update resolvconf for networkd 
DNS.
  Oct  4 10:12:25 localhost rsyslogd-2007: action 'action 11' suspended, next 
retry is Wed Oct  4 10:13:55 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
  Oct  4 10:13:18 localhost systemd[1]: Started Session 23 of user domotz.

  
  Cheers,
  Nicolino

To manage notifications about this bug go to:
https://bugs.launchpad.net/snappy/+bug/1721223/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to