Re: problem with expired prefix (dhcpv6)
Roy Marples
Thu Apr 20 16:41:20 2017
Hi Harri
On 20/04/2017 17:10, Harald Dunkel wrote:
> I am using dhcpcd on an openBSD gateway to obtain a /64 and a /56 prefix
> from Deutsche Telekom via pppoe, router advertisement and dhcpv6. The
> /64 prefix is used for the connection between my gateway and DT's gateway.
> The /56 prefix is delegated to my Lan via dnsmasq.
>
> Problem:
>
> If I reset the pppoe connection, then the lease for the /56 prefix cannot
> be reused. My gateway gets a new /56 prefix, but the old IPv6 address is not
> removed from the internal NIC. dhcpcd assigns just a second address based
> on the new prefix, confusing dnsmasq. I am not sure if this is correct.
>
> Here is the syslog for a sample session:
>
> Apr 20 13:27:35 marvin dhcpcd[98699]: DUID 00:01:00:01:20:79:21:d4:80:ee:73:95:c1:0c
> Apr 20 13:27:35 marvin dhcpcd[98699]: pppoe0: IAID 00:00:00:00
> Apr 20 13:27:35 marvin dhcpcd[98699]: pppoe0: rebinding prior DHCPv6 lease
> Apr 20 13:27:35 marvin dhcpcd[98699]: re1: waiting for carrier
> Apr 20 13:27:35 marvin dhcpcd[98699]: pppoe0: soliciting an IPv6 router
> Apr 20 13:27:36 marvin dhcpcd[98699]: re1: carrier acquired
> Apr 20 13:27:36 marvin dhcpcd[98699]: re1: IAID 73:95:c1:0d
> Apr 20 13:27:37 marvin dhcpcd[98699]: pppoe0: Router Advertisement from fe80::101:101:3e9b:f1ab
> Apr 20 13:27:37 marvin dhcpcd[98699]: pppoe0: adding address 2003:dd:b3bf:2325:665a:4ff:fe35:830a/64
> Apr 20 13:27:45 marvin dhcpcd[98699]: pppoe0: failed to rebind prior delegation
> Apr 20 13:27:45 marvin dhcpcd[98699]: pppoe0: soliciting a DHCPv6 lease
> Apr 20 13:27:47 marvin dhcpcd[98699]: pppoe0: REPLY6 received from fe80::101:101:3e9b:f1ab
> Apr 20 13:27:47 marvin dhcpcd[98699]: pppoe0: renew in 900, rebind in 1440, expire in 14400 seconds
> Apr 20 13:27:47 marvin dhcpcd[98699]: lo0: adding reject route to 2003:dd:b3e3:2500::/56 via ::1
> Apr 20 13:27:47 marvin dhcpcd[98699]: pppoe0: delegated prefix 2003:dd:b3e3:2500::/56
> Apr 20 13:27:47 marvin dhcpcd[98699]: re1: adding address 2003:dd:b3e3:2500::1/56
> Apr 20 13:27:47 marvin dhcpcd[98699]: re1: changing route to 2003:dd:b3e3:2500::/56
> Apr 20 13:27:47 marvin dhcpcd[98699]: forked to background, child pid 46072
> Apr 20 13:30:39 marvin dhcpcd[46072]: pppoe0: carrier lost
> Apr 20 13:30:39 marvin dhcpcd[46072]: pppoe0: deleting address 2003:dd:b3bf:2325:665a:4ff:fe35:830a/64
> Apr 20 13:30:39 marvin dhcpcd[46072]: pppoe0: if_addrflags: 93.233.206.36: Undefined error: 0
> Apr 20 13:30:39 marvin dhcpcd[46072]: pppoe0: if_addrflags: Undefined error: 0
These bogus error messages should be fixed in dhcpcd-7.0.0-beta3 on
OpenBSD. Can you verify this please? You didn't say which version you're
using.
> Apr 20 13:30:54 marvin dhcpcd[46072]: pppoe0: carrier acquired
> Apr 20 13:30:54 marvin dhcpcd[46072]: pppoe0: IAID 00:00:00:00
> Apr 20 13:30:54 marvin dhcpcd[46072]: pppoe0: rebinding prior DHCPv6 lease
> Apr 20 13:30:54 marvin dhcpcd[46072]: pppoe0: Router Advertisement from fe80::101:101:3e9b:f1ab
> Apr 20 13:30:54 marvin dhcpcd[46072]: pppoe0: adding address 2003:dd:b3bf:2336:665a:4ff:fe35:830a/64
> Apr 20 13:31:04 marvin dhcpcd[46072]: pppoe0: failed to rebind prior delegation
This is the interesting part.
Why did this fail?
Can you capture a full tcpdump of the DHCPv6 transaction please?
> Apr 20 13:31:04 marvin dhcpcd[46072]: pppoe0: soliciting a DHCPv6 lease
> Apr 20 13:31:07 marvin dhcpcd[46072]: pppoe0: REPLY6 received from fe80::101:101:3e9b:f1ab
> Apr 20 13:31:07 marvin dhcpcd[46072]: pppoe0: renew in 900, rebind in 1440, expire in 14400 seconds
> Apr 20 13:31:07 marvin dhcpcd[46072]: lo0: adding reject route to 2003:dd:b3e3:3600::/56 via ::1
> Apr 20 13:31:07 marvin dhcpcd[46072]: pppoe0: delegated prefix 2003:dd:b3e3:3600::/56
> Apr 20 13:31:07 marvin dhcpcd[46072]: re1: adding address 2003:dd:b3e3:3600::1/56
> Apr 20 13:31:07 marvin dhcpcd[46072]: re1: changing route to 2003:dd:b3e3:3600::/56
> Apr 20 13:42:32 marvin dhcpcd[46072]: received SIGTERM, stopping
> Apr 20 13:42:32 marvin dhcpcd[46072]: re1: removing interface
> Apr 20 13:42:32 marvin dhcpcd[46072]: re1: deleting address 2003:dd:b3e3:2500::1/56
> Apr 20 13:42:32 marvin dhcpcd[46072]: re1: deleting address 2003:dd:b3e3:3600::1/56
> Apr 20 13:42:32 marvin dhcpcd[46072]: lo0: changing reject route to 2003:dd:b3e3:3600::/56 via ::1
> Apr 20 13:42:32 marvin dhcpcd[46072]: re1: deleting route to 2003:dd:b3e3:2500::/56
> Apr 20 13:42:32 marvin dhcpcd[46072]: pppoe0: removing interface
> Apr 20 13:42:32 marvin dhcpcd[46072]: lo0: deleting reject route to 2003:dd:b3e3:3600::/56 via ::1
> Apr 20 13:42:32 marvin dhcpcd[46072]: pppoe0: deleting address 2003:dd:b3bf:2336:665a:4ff:fe35:830a/64
> Apr 20 13:42:32 marvin dhcpcd[46072]: dhcpcd exited
>
> Look for "pppoe0: carrier lost" at 13:30:39, when I reset the pppoe0
> interface. There is no "re1: deleting address ..." following, just
> another IPv6 address assigned to re1. Both addresses have infinite
> lifetime, but of course the old prefix is not routed anymore.
This is an issue with OpenBSD.
See my comment about the problem here:
https://dev.marples.name/source/dhcpcd/browse/master/src/if-bsd.c;dd0311a9d743e79bbb1795c12d4efb6c78f9e0bf$758
You didn't say what version of dhcpcd OR OpenBSD you're using.
This *should* be fixed in dhcpcd-6.11.4 onwards, but I've not
extensively tested it.
It *might* be broken for the carrier down case.
I'll see if I can replicate it once you report the versions in play.
> If I shutdown dhcpcd, then both addresses are deleted.
>
> Here is my dhcpcd.conf:
>
> ipv6only
> # persistent
> option rapid_commit
> require dhcp_server_identifier
> nohook lookup-hostname, resolv.conf
> allowinterfaces re1 pppoe0
> noipv6rs
>
> interface pppoe0
> ipv6rs
> # static static domain_name_servers=<nameserver IPs>
> iaid 0
> ia_pd 0 re1/0
I suppose we could make the delegated prefixes vanish on carrier down
for non persistent interfaces if we can't get it to work properly on
OpenBSD.
Roy
Archive administrator: postmaster@marples.name