[systemd-devel] systemd-networkd: keeping old routes when new dhcp lease was given
Kaisrlík, Jan
jan.kaisrlik at avast.com
Tue Jun 11 09:12:15 UTC 2019
Hello here,
I am running Yocto-thud with systemd 239 on my SoC and I've found
interesting, when DHCP lease was prolonged, I observe the connection
to the internet was completely stopped.
Based on the logs in the system I strongly believe it is connected to
moment when networkd renews a dhcp lease when it expires:
# cat /var/log/daemon.log | grep "networkd\["
2019-05-29T11:55:12.159213+00:00 x systemd-networkd[250]: Enumeration
completed
2019-05-29T11:55:12.159253+00:00 x systemd-networkd[250]: lo: Link is not
managed by us
2019-05-29T11:55:12.159294+00:00 x systemd-networkd[250]: veth0: netdev
ready
2019-05-29T11:55:12.170082+00:00 x systemd-networkd[250]:
request_name_destroy_callback n_ref=1
2019-05-29T11:55:14.053408+00:00 x systemd-networkd[250]: eth0: Gained
carrier
2019-05-29T11:55:14.058588+00:00 x systemd-networkd[250]: veth0: Gained
carrier
2019-05-29T11:55:15.057317+00:00 x systemd-networkd[250]: eth0: DHCPv4
address 192.168.0.122/24 via 192.168.0.1
2019-05-29T11:55:15.088632+00:00 x systemd-networkd[250]: veth0: Gained
IPv6LL
2019-05-29T11:55:15.088833+00:00 x systemd-networkd[250]: veth0: Configured
2019-05-29T11:55:15.632514+00:00 x systemd-networkd[250]: eth0: Gained
IPv6LL
2019-05-29T11:55:15.632621+00:00 x systemd-networkd[250]: eth0: Configured
2019-05-29T11:55:23.787104+00:00 x systemd-networkd[250]: tun0: Gained
carrier
2019-05-29T11:55:23.787425+00:00 x systemd-networkd[250]: tun0: Gained
IPv6LL
2019-06-03T08:27:42.019202+00:00 x systemd-networkd[250]: tun0: Lost carrier
2019-06-03T08:28:14.017067+00:00 x systemd-networkd[250]: tun0: Gained
carrier
2019-06-03T08:28:14.017287+00:00 x systemd-networkd[250]: tun0: Gained
IPv6LL
2019-06-04T05:27:31.261841+00:00 x systemd-networkd[250]: eth0: DHCPv4
address 192.168.0.125/24 via 192.168.0.1
2019-06-04T08:27:56.178984+00:00 x systemd-networkd[250]: tun0: Lost carrier
>From the log above you can observe the lease was prolonged
successfully and new ip address was given and from this particular
moment the board was not able to connect to the internet.
During the debugging I found this : the routes in the system are wrong
and route with old ip address still exists in the system.
# ip route
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.122 metric 1024
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.125 metric 1024
10.1.2.252/30 dev veth0 proto kernel scope link src 10.255.254.253
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.125
192.168.0.1 dev eth0 proto dhcp scope link src 192.168.0.122 metric 1024
192.168.0.1 dev eth0 proto dhcp scope link src 192.168.0.125 metric 1024
In addition I'm adding outputs from ip tool and networkctl.
# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
group default qlen 1000
link/ether e0:91:53:a3:9a:81 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.125/24 brd 192.168.0.255 scope global dynamic eth0
valid_lft 55210sec preferred_lft 55210sec
inet6 fe80::e291:53ff:fea3:9a81/64 scope link
valid_lft forever preferred_lft forever
# networkctl status eth0
● 2: eth0
Link File: /lib/systemd/network/99-default.link
Network File: /etc/systemd/network/eth-p2p.network
Type: ether
State: routable (configured)
Path: platform-ff3f0000.ethernet
HW Address: e0:91:53:a3:9a:81 (XAVi Technologies Corp.)
Address: 192.168.0.125
fe80::e291:53ff:fea3:9a81
Gateway: 192.168.0.1 (Tenda Technology Co.,Ltd.Dongguan branch)
192.168.0.1 (Tenda Technology Co.,Ltd.Dongguan branch)
DNS: 192.168.0.1
What is even more interesting is the following output which does not
fully correlate with output from ip and networkctl.
# cat /run/systemd/netif/links/2
# This is private data. Do not parse.
ADMIN_STATE=configured
OPER_STATE=routable
REQUIRED_FOR_ONLINE=yes
NETWORK_FILE=/etc/systemd/network/eth-p2p.network
DNS=192.168.0.1
NTP=
DOMAINS=
ROUTE_DOMAINS=
LLMNR=yes
MDNS=no
ADDRESSES=192.168.0.125/24 192.168.0.122/24
ROUTES=192.168.0.1/32/0/1024/254/18446744073709551615
0.0.0.0/0/0/1024/254/18446744073709551615
DHCP4_ADDRESS=192.168.0.125
DHCP_LEASE=/run/systemd/netif/leases/2
Unfortunately, pcaps and more verbose systemd logs are not currently
available.
Have you ever seen similar issue?
Thank you in you advice.
Best regards,
--
Jan Kaisrlik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190611/3e96ff39/attachment.html>
More information about the systemd-devel
mailing list