dhcpcd-discuss

v6 Default route note re-created on re-bind?

Nathan O'Meara

Sat May 27 01:23:57 2017

I've been noticing an issue on my home router (gentoo linux,
dhcpcd-6.11.3).  I have been running ipv4+ipv6 for a while, but I've
noticed an issue when my modem is rebooted by my ISP.  After the modem
reboot, despite dhcpcd obtaining a new/renewed IPv6 lease, IPv6 routing is
broken.  It looks like the auto-created default v6 route is not being
created on rebind?  Logs and more detail below.  I am unsure if this is due
to a bug, or due to a misconfiguration on my part.  I looked up the
changelogs for 6.11.4 and 6.11.5 since 6.11.5 is in portage, but I didn't
see anything relating to this listed as a change.

Normal startup:
May 16 08:04:28 hostname dhcpcd[4751]: wan0: waiting for carrier
May 16 08:04:32 hostname dhcpcd[4751]: wan0: carrier acquired
May 16 08:04:32 hostname dhcpcd[4751]: wan0: adding address
fe80::a55b:77ab:6986:dc91
May 16 08:04:32 hostname dhcpcd[4751]: DUID
00:01:00:01:1a:89:29:b4:80:ee:73:3c:5e:01
May 16 08:04:32 hostname dhcpcd[4751]: wan0: IAID ca:3e:b5:4e
May 16 08:04:32 hostname dhcpcd[4751]: wan0: IAID 73:3c:5e:01
May 16 08:04:33 hostname dhcpcd[4751]: wan0: rebinding lease of <ipv4addr>
May 16 08:04:33 hostname dhcpcd[4751]: wan0: probing address <ipv4addr>/19
May 16 08:04:34 hostname dhcpcd[4751]: wan0: rebinding prior DHCPv6 lease
May 16 08:04:34 hostname dhcpcd[4751]: lan0: activating for delegation
May 16 08:04:34 hostname dhcpcd[4751]: lan0: carrier acquired
May 16 08:04:34 hostname dhcpcd[4751]: lan0: IAID ca:0d:29:cb
May 16 08:04:34 hostname dhcpcd[4751]: wan0: REPLY6 received from
fe80::201:5cff:fe68:1e46
May 16 08:04:34 hostname dhcpcd[4751]: wan0: renew in 302400, rebind in
483840, expire in 604800 seconds
May 16 08:04:34 hostname dhcpcd[4751]: lo: adding reject route to
<ipv6prefix>::/64 via ::1
May 16 08:04:34 hostname dhcpcd[4751]: wan0: delegated prefix
<ipv6prefix>::/64
May 16 08:04:34 hostname dhcpcd[4751]: lan0: adding address
<ipv6prefix>::1/64
May 16 08:04:34 hostname dhcpcd[4751]: lan0: adding route to
<ipv6prefix>::/64
May 16 08:04:34 hostname dhcpcd[4751]: lo: deleting reject route to
<ipv6prefix>::/64 via ::1
May 16 08:04:34 hostname dhcpcd[4751]: lan0: soliciting a DHCP lease
May 16 08:04:38 hostname dhcpcd[4751]: wan0: leased <ipv4addr> for 85431
seconds
May 16 08:04:38 hostname dhcpcd[4751]: wan0: adding route to 107.10.32.0/19
May 16 08:04:38 hostname dhcpcd[4751]: wan0: adding default route via
107.10.32.1
May 16 08:04:38 hostname dhcpcd[4751]: forked to background, child pid 4793
May 16 08:04:39 hostname dhcpcd[4793]: lan0: probing for an IPv4LL address
May 16 08:04:43 hostname dhcpcd[4793]: lan0: using IPv4LL address
169.254.163.138
May 16 08:04:43 hostname dhcpcd[4793]: lan0: adding route to 169.254.0.0/16

Route present after normal startup:
Destination                    Next Hop                   Flag Met Ref Use
If
::/0                           fe80::201:5cff:fe68:1e46   UGDAe 1024 2
13474 wan0

after modem reboot:
May 16 01:43:31 hostname dhcpcd[4803]: wan0: carrier lost
May 16 01:43:31 hostname dhcpcd[4803]: wan0: deleting address
fe80::a55b:77ab:6986:dc91
May 16 01:43:31 hostname dhcpcd[4803]: wan0: deleting route to
107.10.32.0/19
May 16 01:43:31 hostname dhcpcd[4803]: wan0: deleting default route via
107.10.32.1
May 16 01:43:49 hostname dhcpcd[4803]: wan0: carrier acquired
May 16 01:43:49 hostname dhcpcd[4803]: wan0: adding address
fe80::a55b:77ab:6986:dc91
May 16 01:43:49 hostname dhcpcd[4803]: wan0: IAID ca:3e:b5:4e
May 16 01:43:49 hostname dhcpcd[4803]: wan0: IAID 73:3c:5e:01
May 16 01:43:50 hostname dhcpcd[4803]: wan0: rebinding lease of <ipv4addr>
May 16 01:43:51 hostname dhcpcd[4803]: wan0: rebinding prior DHCPv6 lease
May 16 01:43:52 hostname dhcpcd[4803]: wan0: carrier lost
May 16 01:43:52 hostname dhcpcd[4803]: wan0: deleting address
fe80::a55b:77ab:6986:dc91
May 16 01:43:55 hostname dhcpcd[4803]: wan0: carrier acquired
May 16 01:43:55 hostname dhcpcd[4803]: wan0: adding address
fe80::a55b:77ab:6986:dc91
May 16 01:43:55 hostname dhcpcd[4803]: wan0: IAID ca:3e:b5:4e
May 16 01:43:55 hostname dhcpcd[4803]: wan0: IAID 73:3c:5e:01
May 16 01:43:55 hostname dhcpcd[4803]: wan0: rebinding lease of <ipv4addr>
May 16 01:43:56 hostname dhcpcd[4803]: wan0: rebinding prior DHCPv6 lease
May 16 01:44:00 hostname dhcpcd[4803]: wan0: probing for an IPv4LL address
May 16 01:44:00 hostname dhcpcd[4803]: wan0: DHCP lease expired
May 16 01:44:00 hostname dhcpcd[4803]: wan0: soliciting a DHCP lease
May 16 01:44:02 hostname dhcpcd[4803]: wan0: offered 192.168.100.10 from
192.168.100.1
May 16 01:44:02 hostname dhcpcd[4803]: wan0: probing address
192.168.100.10/24
May 16 01:44:05 hostname dhcpcd[4803]: wan0: using IPv4LL address
169.254.253.242
May 16 01:44:05 hostname dhcpcd[4803]: wan0: changing route to
169.254.0.0/16
May 16 01:44:05 hostname dhcpcd[4803]: wan0: adding default route
May 16 01:44:06 hostname dhcpcd[4803]: wan0: failed to rebind prior
delegation
May 16 01:44:06 hostname dhcpcd[4803]: wan0: soliciting a DHCPv6 lease
May 16 01:44:07 hostname dhcpcd[4803]: wan0: leased 192.168.100.10 for 20
seconds
May 16 01:44:07 hostname dhcpcd[4803]: wan0: adding route to
192.168.100.0/24
May 16 01:44:07 hostname dhcpcd[4803]: wan0: changing default route via
192.168.100.1
May 16 01:44:07 hostname dhcpcd[4803]: lan0: changing route to
169.254.0.0/16
May 16 01:44:07 hostname dhcpcd[4803]: lan0: deleted route to 169.254.0.0/16
May 16 01:44:18 hostname dhcpcd[4803]: lan0: adding route to 169.254.0.0/16
May 16 01:44:35 hostname dhcpcd[4803]: wan0: failed to renew DHCP, rebinding
May 16 01:44:35 hostname dhcpcd[4803]: wan0: ADV <ipv6prefix>::/64 from
fe80::201:5cff:fe68:1e46
May 16 01:44:35 hostname dhcpcd[4803]: wan0: REPLY6 received from
fe80::201:5cff:fe68:1e46
May 16 01:44:35 hostname dhcpcd[4803]: wan0: renew in 302400, rebind in
483840, expire in 604800 seconds
May 16 01:44:35 hostname dhcpcd[4803]: lo: adding reject route to
<ipv6prefix>::/64 via ::1
May 16 01:44:35 hostname dhcpcd[4803]: wan0: delegated prefix
<ipv6prefix>::/64
May 16 01:44:35 hostname dhcpcd[4803]: lo: deleting reject route to
<ipv6prefix>::/64 via ::1
May 16 01:44:35 hostname dhcpcd-run-hooks[6847]: wan0: Restarting radvd
May 16 01:44:38 hostname dhcpcd[4803]: wan0: DHCP lease expired
May 16 01:44:38 hostname dhcpcd[4803]: wan0: deleting route to
192.168.100.0/24
May 16 01:44:38 hostname dhcpcd[4803]: wan0: deleting default route via
192.168.100.1
May 16 01:44:38 hostname dhcpcd[4803]: wan0: soliciting a DHCP lease
May 16 01:44:38 hostname dhcpcd[4803]: wan0: offered <ipv4addr> from
142.254.155.105
May 16 01:44:38 hostname dhcpcd[4803]: wan0: probing address <ipv4addr>/19
May 16 01:44:43 hostname dhcpcd[4803]: wan0: leased <ipv4addr> for 61426
seconds
May 16 01:44:43 hostname dhcpcd[4803]: wan0: adding route to 107.10.32.0/19
May 16 01:44:43 hostname dhcpcd[4803]: wan0: adding default route via
107.10.32.1


In the normal startup, I see this line, which I don't see in the rebind log:
May 16 08:04:34 hostname dhcpcd[4751]: lan0: adding route to
<ipv6prefix>::/64

And after rebind, `route -6n` contains no routes with next hops defined.
Hence, no routing to ipv6 nets.  Is this a bug, or am I misconfigured
somewhere?  I could add some logic to my run-hook to bind this route, but
it seems to me if it is auto-created on initial lease, it should also be
auto-created on rebind/renew lease.  My run-hook is pretty simple, it
simply checks if $new_dhcp6_ia_pd1_prefix1 <> $old_dhcp6_ia_pd1_prefix1,
and if that is true, restarts radvd if it was already running so it
deprecates the old prefix and advertises the new prefix.  This happened
again today, and I was able to restore v6 routing by manually adding a
default route matching the default route created automatically on first
initialization.  I will fully admit to not understanding all the
configuration options, it took me a lot of searching to find
recommendations for this config that worked, and it does seem to work fine
for the initial configuration.

$ grep -v "^#" /etc/dhcpcd.conf | grep -v "^$"
hostname
duid
persistent
waitip 6
noipv6rs
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
nohook lookup-hostname
interface wan0
ia_pd 73:3c:5e:01/::/64 lan0/0/64


Thanks for taking a look at this,
Nathan

Follow-Ups:
Re: v6 Default route note re-created on re-bind?Roy Marples
Archive administrator: postmaster@marples.name