You are not logged in.

#1 2021-01-12 16:57:19

bWF0a3Vr
Member
Registered: 2021-01-02
Posts: 6

Where can I inspect DHCPv6 leases (systemd-networkd)?

I use systemd-networkd as my network manager and DHCPv6 client. I have set up a minimalist configuration file like:
[Match]
Name=eth0

[Network]
DHCP=ipv6

DHCPv6 is active on my router (backend). When I start systemd-networkd the network interface gets assigned an IPv6 address through DHCPv6.
This is the output from journaltctl -b -u systemd-networkd (I masked the first 112 bits of the IPv6 address on purpose):
Jan 07 22:29:26 host01 systemd[1]: Starting Network Service...
Jan 07 22:29:26 host01 systemd-networkd[352]: Enumeration completed
Jan 07 22:29:26 host01 systemd[1]: Started Network Service.
Jan 07 22:29:26 host01 systemd-networkd[352]: eth0: Link UP
Jan 07 22:29:26 host01 systemd-networkd[352]: eth0: Gained carrier
Jan 07 22:29:27 host01 systemd-networkd[352]: eth0: Gained IPv6LL
Jan 07 22:29:28 host01 systemd-networkd[352]: eth0: DHCPv6 address 1234:abcd:1234:abcd:1234:abcd:1234:75c1/128 timeout preferred 3600 valid 7200

I can confirm this through ip -6 a show dev eth0 (I masked the first 112 bits of the IPv6 address on purpose and removed the Link-Local IPv6 address):
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet6 1234:abcd:1234:abcd:1234:abcd:1234:75c1/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 6005sec preferred_lft 1728sec

The network interface works, since I can ping IPv6 address across the Internet.

However I can't find information about the DHCPv6 lease in /run/systemd/netif/leases. When I set up DHCP(v4), a lease-file is created. Not with DHCPv6 however.
Furthermore if I run cat /run/systemd/netif/links/2 with DHCP(v4) I can see the following entry:
DHCP_LEASE=/run/systemd/netif/leases/2

If I use DHCPv6 the entry is missing.

1. Where can I find the lease file associated with DHCPv6?
2. Is it normal that the assigned DHCPv6 address is the same as the IPv6 address I would get when using Router Advertisement (SLAAC) without any DHCP services at all?
3. Why does the log show 128 CIDR, meanwhile the network interface shows 64 CIDR?

Thanks.

Last edited by bWF0a3Vr (2021-01-12 17:03:13)

Offline

#2 2021-01-12 22:32:31

52xUYE
Member
Registered: 2021-01-08
Posts: 5

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

Have you checked: 

dhclient - Dynamic Host Configuration Protocol Client

DESCRIPTION
The Internet Systems Consortium DHCP Client, dhclient, provides a means for configuring  one  or more  network  interfaces  using  the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address.

AND

dhclient.leases - DHCP client lease database

DESCRIPTION
The  Internet  Systems  Consortium DHCP client keeps a persistent database of leases that it has acquired that are still valid. The database is a free-form ASCII  file  containing  one  valid declaration per lease. If more than one declaration appears for a given lease, the last one in the file is used. The file is written as a log, so this is not an unusual occurrence.

The format of the lease declarations is described in dhclient.conf(5)

1. Where can I find the lease file associated with DHCPv6?
> cat /var/lib/dhclient/dhclient.leases

2. Is it normal that the assigned DHCPv6 address is the same as the IPv6 address I would get when using Router Advertisement (SLAAC) without any DHCP services at all?
> An IPv6 node configures itself with a link-local address (which is derived from its MAC address using the EUI-64 IID method). The router check then check if your address is unique. If it is then it's validated.

https://blogs.infoblox.com/ipv6-coe/sla … rt-1-of-2/


3. Why does the log show 128 CIDR, meanwhile the network interface shows 64 CIDR?
> IDK

Last edited by 52xUYE (2021-01-12 23:00:22)

Offline

#3 2021-01-13 08:02:29

bWF0a3Vr
Member
Registered: 2021-01-02
Posts: 6

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

Thanks for your answer. I was unaware of the fact that the Link-Local IPv6 Address is checked by the Router (the linked article made it clear to me) and - if not in use - is keept.

Regarding dhclient: I don't use it. I use the inbuild DHCPv6 from systemd-networkd (https://wiki.archlinux.org/index.php/systemd-networkd#[DHCP]).

Last edited by bWF0a3Vr (2021-01-13 08:11:20)

Offline

#4 2021-01-14 18:18:26

52xUYE
Member
Registered: 2021-01-08
Posts: 5

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

Systemd-networkd should store the lease info under /run/systemd/netif/leases/


What if you journalctl --all | grep "DHCPv6 lease" or journalctl --all | grep " lease" ?

I don't know much but hope this can help.

Last edited by 52xUYE (2021-01-14 18:27:33)

Offline

#5 2021-01-15 19:38:22

bWF0a3Vr
Member
Registered: 2021-01-02
Posts: 6

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

For some reason I don't get assigned an DHCPv6 at all. A line like shown above ("Jan 07 22:29:28 host01 systemd-networkd[352]: eth0: DHCPv6 address 1234:abcd:1234:abcd:1234:abcd:1234:75c1/128 timeout preferred 3600 valid 7200") doesn't pop up at all:

-- Boot 541d5a957a8f419b880f7a64909ee904 --
Jan 15 20:45:30 arch systemd[1]: Starting Network Service...
Jan 15 20:45:30 arch systemd-networkd[240]: Enumeration completed
Jan 15 20:45:30 arch systemd[1]: Started Network Service.
Jan 15 20:45:30 arch systemd-networkd[240]: eth0: Interface name change detected, eth0 has been renamed to enp5s0.
Jan 15 20:45:31 arch systemd-networkd[240]: enp5s0: Link UP
Jan 15 20:45:33 arch systemd-networkd[240]: enp5s0: Gained carrier
Jan 15 20:45:34 arch systemd-networkd[240]: enp5s0: DHCPv4 address 192.168.178.2/24 via 192.168.178.1
Jan 15 19:45:34 arch systemd-networkd[240]: enp5s0: Gained IPv6LL
Jan 15 20:05:35 arch systemd[1]: Stopping Network Service...
Jan 15 20:05:35 arch systemd-networkd[240]: enp5s0: DHCP lease lost
Jan 15 20:05:35 arch systemd-networkd[240]: enp5s0: DHCPv6 lease lost
Jan 15 20:05:35 arch systemd[1]: systemd-networkd.service: Succeeded.
Jan 15 20:05:35 arch systemd[1]: Stopped Network Service.

For some strange reason I can see that I lost the DHCPv6 lease, but there is no line containing information that the interface was assigned a DHCPv6 lease in the first place.
cat /run/systemd/netif/leases/ show:

# This is private data. Do not parse.
ADDRESS=192.168.178.2
NETMASK=255.255.255.0
ROUTER=192.168.178.1
SERVER_ADDRESS=192.168.178.1
NEXT_SERVER=192.168.178.1
T1=432000
T2=756000
LIFETIME=864000
DNS=192.168.178.1
NTP=192.168.178.1
DOMAINNAME=fritz.box
CLIENTID=<REMOVED IT>

journalctl --all | grep "DHCPv6 lease" shows:
Jan 12 19:50:00 arch systemd-networkd[241]: enp5s0: DHCPv6 lease lost
Jan 12 19:50:13 arch systemd-networkd[241]: enp5s0: DHCPv6 lease lost
Jan 12 19:51:04 arch systemd-networkd[241]: enp5s0: DHCPv6 lease lost
Jan 12 21:08:36 arch systemd-networkd[241]: enp5s0: DHCPv6 lease lost
Jan 12 22:36:29 arch systemd-networkd[233]: enp5s0: DHCPv6 lease lost
Jan 12 23:48:51 arch systemd-networkd[243]: enp5s0: DHCPv6 lease lost
Jan 13 17:21:26 arch systemd-networkd[242]: enp5s0: DHCPv6 lease lost
Jan 14 00:04:07 arch systemd-networkd[230]: enp5s0: DHCPv6 lease lost
Jan 14 14:53:27 arch systemd-networkd[246]: enp5s0: DHCPv6 lease lost
Jan 14 21:18:50 arch systemd-networkd[247]: enp5s0: DHCPv6 lease lost
Jan 15 20:05:35 arch systemd-networkd[240]: enp5s0: DHCPv6 lease lost

Offline

#6 2021-01-15 22:58:34

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

bWF0a3Vr wrote:

For some strange reason I can see that I lost the DHCPv6 lease, but there is no line containing information that the interface was assigned a DHCPv6 lease in the first place.

Did you enable debug logging for systemd-networkd?  As the following should look they would produce output at debug level:

https://github.com/systemd/systemd/blob … cp6.c#L952
https://github.com/systemd/systemd/blob … cp6.c#L994
https://github.com/systemd/systemd/blob … p6.c#L1083

Offline

#7 2021-01-16 15:26:51

bWF0a3Vr
Member
Registered: 2021-01-02
Posts: 6

Re: Where can I inspect DHCPv6 leases (systemd-networkd)?

Thank you. The relevant output looks like this:

Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1s
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: n/a, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/64, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Remembering updated address: <REMOVED>:be5f:f4ff:fe71:752/64 (valid for 1h 21min 11s)
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc SLAAC addresses set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/62, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc routes set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: No SLAAC address obtained from fe80::3ea6:2fff:fe76:2a59 is ready. The old NDisc information will be removed later.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1s
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: n/a, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/64, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Remembering updated address: <REMOVED>:be5f:f4ff:fe71:752/64 (valid for 1h 21min 11s)
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc SLAAC addresses set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/62, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc routes set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: No SLAAC address obtained from fe80::3ea6:2fff:fe76:2a59 is ready. The old NDisc information will be removed later.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1s
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: n/a, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/64, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Remembering updated address: <REMOVED>:be5f:f4ff:fe71:752/64 (valid for 1h 21min 11s)
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc SLAAC addresses set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: Received remembered route: dst: <REMOVED>::/62, src: n/a, gw: fe80::3ea6:2fff:fe76:2a59, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: NDisc routes set.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: No SLAAC address obtained from fe80::3ea6:2fff:fe76:2a59 is ready. The old NDisc information will be removed later.
Jan 16 16:16:42 arch systemd-networkd[124609]: enp5s0: link_check_ready(): an address <REMOVED>:be5f:f4ff:fe71:752/64 is not ready.
Jan 16 16:16:43 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:43 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 2s
Jan 16 16:16:43 arch systemd-networkd[124609]: enp5s0: Remembering updated address: <REMOVED>:be5f:f4ff:fe71:752/64 (valid for 1h 21min 10s)
Jan 16 16:16:43 arch systemd-networkd[124609]: enp5s0: link_check_ready(): dhcp4:yes dhcp6_addresses:no dhcp_routes:no dhcp_pd_addresses:no dhcp_pd_routes:no ndisc_addresses:yes ndisc_routes:yes
Jan 16 16:16:43 arch systemd-networkd[124609]: enp5s0: State changed: configuring -> configured
Jan 16 16:16:43 arch systemd-networkd[124609]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=19 reply_cookie=0 signatur>
Jan 16 16:16:43 arch systemd-networkd[124609]: enp5s0: Removing old NDisc information obtained from fe80::3ea6:2fff:fe76:2a59.
Jan 16 16:16:43 arch systemd-networkd[124609]: enp5s0: Remembering route: dst: <REMOVED>:be5f:f4ff:fe71:752/128, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: local, proto: kernel, type: local
Jan 16 16:16:45 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:45 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 3s
Jan 16 16:16:46 arch systemd-networkd[124609]: rtnl: received non-static neighbor, ignoring.
Jan 16 16:16:49 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:49 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 7s
Jan 16 16:16:53 arch systemd-networkd[124609]: NDISC: No RA received before link confirmation timeout
Jan 16 16:16:53 arch systemd-networkd[124609]: NDISC: Invoking callback for 'timeout' event.
Jan 16 16:16:53 arch systemd-networkd[124609]: enp5s0: NDisc handler get timeout event
Jan 16 16:16:56 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:16:56 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 15s
Jan 16 16:17:12 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:17:12 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 30s
Jan 16 16:17:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:17:42 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1min
Jan 16 16:18:43 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:18:43 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1min 54s
Jan 16 16:20:16 arch systemd-networkd[124609]: rtnl: received non-static neighbor, ignoring.
Jan 16 16:20:22 arch systemd-networkd[124609]: rtnl: received non-static neighbor, ignoring.
Jan 16 16:20:22 arch systemd-networkd[124609]: rtnl: received non-static neighbor, ignoring.
Jan 16 16:20:38 arch systemd-networkd[124609]: DHCPv6 CLIENT: Sent SOLICIT
Jan 16 16:20:38 arch systemd-networkd[124609]: DHCPv6 CLIENT: Next retransmission in 1min 53s

It looks like the DHCPv6 client sends solicitations, which aren't getting answered. Or am I wrong?

Offline

Board footer

Powered by FluxBB