NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52554: IPv6 connections not routing to default gateway



On Tue, Oct 03, 2017 at 02:01:28PM +0100, Roy Marples wrote:
> On 03/10/2017 09:05, Roy Marples wrote:
> > I appear as if by magic wearing my wizards robe and pointy hat!
> > 
> > dhcpcd looks like it should be doing this correctly.
> > https://roy.marples.name/git/dhcpcd.git/tree/src/ipv6nd.c#n506
> 
> OK, so it turned out there were quite a few issues with multiple routers
> in dhcpcd-7 which I've fixed.
> Here's a patch to fix them - it applies to dhcpcd-7.0.0-rc2, which is in
> -current and pkgsrc-current.
> It *might* apply to the version in NetBSD-8, but I'm not sure.
> 
> You could also take a copy of my git dhcpcd repo with these patches
> already or download a tarball from my site and apply the attached patch:
> git://roy.marples.name/dhcpcd.git
> ftp://roy.marples.name/pub/dhcpcd/dhcpcd-7.0.0-rc2.tar.xz
> 
> Let me know how it works out for you!

I opted to try -current again.  I just did a fresh install on the QEMU
KVM.  It is:

NetBSD localhost 8.99.3 NetBSD 8.99.3 (GENERIC) #0: Mon Oct  2
13:47:58 UTC 2017
mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC
amd64

so I trust that it will have all of your latest patches.  However, I
still have the same problem as with NetBSD-8.  I'll attach a debug log
from booting with "-d -j /var/log/dhcpcd -qM wm0".  The routing table
looks like this after getting the router advertisements:

localhost# netstat -nr -f inet6|head
Routing tables

Internet6:
Destination                             Gateway
Flags    Refs      Use    Mtu Interface
::/104                                  ::1
UGRS        -        -  33624  lo0
::/96                                   ::1
UGRS        -        -  33624  lo0
default                                 fe80::ec4:7aff:feda:2e47
UGS         -        -      -  wm0
::1                                     lo0
UHl         -        -  33624  lo0
::127.0.0.0/104                         ::1
UGRS        -        -  33624  lo0
::224.0.0.0/100                         ::1
UGRS        -        -  33624  lo0

The "default" should be this one instead:

default                                 fe80::ec4:7aff:feda:2df3
UGS         -        -      -  wm0

since that router has a higher preference.

Indeed, as you mentioned earlier, "ndp" doesn't work well when dhcpcd
manages IPv6 addresses.  So, I rebooted with ip6mode set to autohost
and dhcpcd with a -4 flag.  Here is what the peers look like:

# ndp -r
fe80::ec4:7aff:feda:2df3%wm0 if=wm0, flags=O, pref=high, expire=29m43s
fe80::ec4:7aff:feda:2d5b%wm0 if=wm0, flags=O, pref=medium, expire=29m7s
fe80::ec4:7aff:feda:2e47%wm0 if=wm0, flags=O, pref=low, expire=29m2s

-- 
Roy Bixler <rcbixler%nyx.net@localhost>
"The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment."
-- Richard P. Feynman
Oct 03 13:58:42 [142]: dhcpcd-7.0.0-rc2 starting
Oct 03 13:58:42 [142]: wm0: disabling Kernel IPv6 auto link-local support
Oct 03 13:58:42 [142]: wm0: disabling Kernel IPv6 RA support
Oct 03 13:58:42 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' PREINIT
Oct 03 13:58:42 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' CARRIER
Oct 03 13:58:42 [142]: DUID 00:01:00:01:21:66:53:b4:52:54:00:12:34:57
Oct 03 13:58:42 [142]: wm0: IAID 00:12:34:57
Oct 03 13:58:42 [142]: wm0: delaying IPv6 router solicitation for 1.0 seconds
Oct 03 13:58:42 [142]: wm0: delaying IPv4 for 0.8 seconds
Oct 03 13:58:43 [142]: wm0: reading lease `/var/db/dhcpcd/wm0.lease'
Oct 03 13:58:43 [142]: wm0: rebinding lease of 10.217.128.51
Oct 03 13:58:43 [142]: wm0: sending REQUEST (xid 0xdc5a39a8), next in 3.2 seconds
Oct 03 13:58:43 [142]: wm0: acknowledged 10.217.128.51 from 10.217.171.109
Oct 03 13:58:43 [142]: wm0: adding IP address 10.217.128.51/21 broadcast 10.217.135.255
Oct 03 13:58:43 [142]: wm0: soliciting an IPv6 router
Oct 03 13:58:43 [142]: wm0: sending Router Solicitation
Oct 03 13:58:43 [142]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2e47
Oct 03 13:58:43 [142]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:58:43 [142]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:58:43 [142]: wm0: adding route to 2620:105:c000:3::/64
Oct 03 13:58:43 [142]: wm0: adding default route via fe80::ec4:7aff:feda:2e47
Oct 03 13:58:43 [142]: wm0: waiting for Router Advertisement DAD to complete
Oct 03 13:58:43 [142]: wm0: requesting DHCPv6 information
Oct 03 13:58:43 [142]: wm0: delaying INFORM6 (xid 0xbd7c28), next in 0.1 seconds
Oct 03 13:58:43 [142]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2d5b
Oct 03 13:58:43 [142]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:58:43 [142]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:58:43 [142]: wm0: waiting for Router Advertisement DAD to complete
Oct 03 13:58:43 [142]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2df3
Oct 03 13:58:43 [142]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:58:43 [142]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:58:43 [142]: wm0: waiting for Router Advertisement DAD to complete
Oct 03 13:58:43 [142]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 0.9 seconds
Oct 03 13:58:44 [142]: wm0: Router Advertisement DAD completed
Oct 03 13:58:44 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:58:44 [142]: wm0: Router Advertisement DAD completed
Oct 03 13:58:44 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:58:44 [142]: wm0: Router Advertisement DAD completed
Oct 03 13:58:44 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:58:44 [142]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 1.8 seconds
Oct 03 13:58:46 [142]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 3.8 seconds
Oct 03 13:58:48 [142]: wm0: DAD completed for 10.217.128.51
Oct 03 13:58:48 [142]: wm0: leased 10.217.128.51 for 691200 seconds
Oct 03 13:58:48 [142]: wm0: renew in 345600 seconds, rebind in 604800 seconds
Oct 03 13:58:48 [142]: wm0: writing lease `/var/db/dhcpcd/wm0.lease'
Oct 03 13:58:48 [142]: wm0: IP address 10.217.128.51/21 already exists
Oct 03 13:58:48 [142]: wm0: adding route to 10.217.128.0/21
Oct 03 13:58:48 [142]: wm0: adding default route via 10.217.128.2
Oct 03 13:58:48 [142]: wm0: ARP announcing 10.217.128.51 (1 of 2), next in 2.0 seconds
Oct 03 13:58:48 [142]: wm0: executing `/libexec/dhcpcd-run-hooks' BOUND
Oct 03 13:58:48 [142]: forking to background
Oct 03 13:58:48 [142]: forked to background, child pid 287
Oct 03 13:58:50 [287]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 7.2 seconds
Oct 03 13:58:50 [287]: wm0: ARP announcing 10.217.128.51 (2 of 2)
Oct 03 13:58:53 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2e47
Oct 03 13:58:53 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:58:53 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:58:53 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:58:53 [287]: wm0: failed to request information
Oct 03 13:58:57 [287]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 14.0 seconds
Oct 03 13:58:58 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2d5b
Oct 03 13:58:58 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:58:58 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:58:58 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:59:11 [287]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 27.1 seconds
Oct 03 13:59:34 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2df3
Oct 03 13:59:34 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:59:34 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:59:34 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:59:38 [287]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 53.4 seconds
Oct 03 13:59:53 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2e47
Oct 03 13:59:53 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:59:53 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:59:53 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 13:59:58 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2d5b
Oct 03 13:59:58 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 13:59:58 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 13:59:58 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
Oct 03 14:00:31 [287]: wm0: broadcasting INFORM6 (xid 0xbd7c28), next in 103.3 seconds
Oct 03 14:00:34 [287]: wm0: Router Advertisement from fe80::ec4:7aff:feda:2df3
Oct 03 14:00:34 [287]: wm0: adding address 2620:105:c000:3:f094:3ebf:4f09:5853/64
Oct 03 14:00:34 [287]: wm0: pltime 1800 seconds, vltime 1800 seconds
Oct 03 14:00:34 [287]: wm0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT


Home | Main Index | Thread Index | Old Index