IPv6 dhcpc issues?

Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware
Author Message
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 15:50    Post subject: IPv6 dhcpc issues? Reply with quote
Hello,

I have a Dlink DIR-882A running (currently) build v3.0-r35767 std (04/19/18).

My ISP supports IPv6 DHCP with prefix delegation.

I enabled "DHCPv6 with Prefix Delegation" in Basic > IPv6, set the appropriate prefix length (48), enabled radvd, and disabled "dhcp6c custom" and "dhcp6s".

I find that the router itself does not normally receive IPv6 routes from the ISP (and consequently clients on the LAN cannot talk to the outside world via IPv6).

Code:

# ip -6 a
1: lo: <LOOPBACK,MULTICAST,UP,LOWER_UP> mtu 65536
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::7a32:1bff:fe6c:607e/64 scope link
       valid_lft forever preferred_lft forever
5: vlan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet6 fe80::7a32:1bff:fe6c:607e/64 scope link
       valid_lft forever preferred_lft forever
6: vlan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet6 <my public prefix>:7a32:1bff:fe6c:607f/64 scope global dynamic
       valid_lft 2591472sec preferred_lft 604272sec
    inet6 fe80::7a32:1bff:fe6c:607f/64 scope link
       valid_lft forever preferred_lft forever
9: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet6 <my transfer prefix>::200:ff:fe00:0/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::7a32:1bff:fe6c:607e/64 scope link
       valid_lft forever preferred_lft forever
37: ra0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 3000
    inet6 fe80::7a32:1bff:fe6c:607e/64 scope link
       valid_lft forever preferred_lft forever
38: ba0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 3000
    inet6 fe80::7a32:1bff:fe6c:607f/64 scope link
       valid_lft forever preferred_lft forever

# ip -6 r
<my public prefix>::/64 dev vlan2  metric 256  expires 0sec
<my transfer prefix>::/64 dev br0  metric 256
fe80::/64 dev eth0  metric 256
fe80::/64 dev br0  metric 256
fe80::/64 dev vlan1  metric 256
fe80::/64 dev ra0  metric 256
fe80::/64 dev ba0  metric 256
fe80::/64 dev vlan2  metric 256
default via fe80::8a43:e1ff:feca:733f dev vlan2  metric 1024  expires 0sec
unreachable default dev lo  metric -1  error -128
ff00::/8 dev eth0  metric 256
ff00::/8 dev br0  metric 256
ff00::/8 dev vlan1  metric 256
ff00::/8 dev ra0  metric 256
ff00::/8 dev ba0  metric 256
ff00::/8 dev vlan2  metric 256
unreachable default dev lo  metric -1  error -128


I thought there was something wrong with the ISP's DHCP leases, so I spent some time mucking about with dhcp6c trying to add -D flags so I could debug leases. Despite killing and restarting dhcp6c with the -D flag, I never see info in syslog (???), but after some time mucking with that and killing udhcpc (which I see only does IPv4 anyway) I did manage to, temporarily, pick up a lease that worked. (It had usable routes, and IPv6 connections to the outside world worked both from the router and clients on the LAN.)

This led me to think there's something wrong with udhcpc. I stumbled upon https://patchwork.openembedded.org/patch/146750/, which made me think some versions of udhcpc are clearing IPv6 settings when refreshing IPv4 leases.

Any ideas? I could be barking up entirely the wrong tree, but I'm at a loss to explain why the router is not getting any usable routes from the ISP.

(I'm also interested in suggestions for inspecting the received DHCP leases. Why does "dhcp6c -D" not work?)

Thanks.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Apr 22, 2018 16:05    Post subject: Reply with quote
You got a Public IPv6 on br0.

I use dnsmasq instead of radvd.

Services->Additional DNSMasq Options:

quiet-dhcp
quiet-dhcp6
quiet-ra
enable-ra
dhcp-range=::10,::200,constructor:br0,ra-names,slaac,64,24h
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 16:13    Post subject: Reply with quote
Quote:
You got a Public IPv6 on br0.


Sort of correct. br0 has an IP within the assigned /48 prefix. I believe this is WAI.

Quote:
I use dnsmasq instead of radvd.


I am not sure that's relevant. The router itself has no usable (IPv6) routes. If the router had usable routes but LAN clients did not, I could imagine it's an radvd or dnsmasq issue, but I don't think we're even there yet--the router itself can't talk IPv6 to the outside world!

Thanks for the reply!
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Apr 22, 2018 16:43    Post subject: Reply with quote
I don't have a Public ip on the WAN interface.
I have split the prefix up into 3 interfaces.

My Dhcp6c config:

interface eth0 {
send rapid-commit;
send ia-pd 1;
request domain-name-servers, domain-name;
};

id-assoc pd 1 {
prefix ::/48 infinity;
prefix-interface br0 {
sla-id 0;
sla-len 16;
};
prefix-interface ath1 {
sla-id 1;
sla-len 16;
};
prefix-interface eth1.3 {
sla-id 2;
sla-len 16;
};
};


You have to adjust interface eth0 to your WAN interface.
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 17:14    Post subject: Reply with quote
Hmm, what do you mean, you don't have a public IP on the WAN interface? The whole point of the WAN interface is to have a public IP. :)

In any event, your dhcp6c.conf is very close to the default--I'm not very familiar with all of these options, but I'm not sure any of them are responsible for not setting up routing information (though they may be).

The default, FWIW:

Code:

interface vlan2 {
 send ia-pd 0;
 send rapid-commit;
 request domain-name-servers;
 script "/sbin/dhcp6c-state";
};
id-assoc pd 0 {
 prefix-interface br0 {
  sla-id 0;
  sla-len 16;
 };
};
id-assoc na 0 { };
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Apr 22, 2018 18:53    Post subject: Reply with quote
Routing will take place over the Link Local Address (FE80)
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 19:46    Post subject: Reply with quote
I may be totally confused, but isn't the point of a delegated prefix that the router can hand out public (routable) IPs within that prefix range to DHCP clients on the LAN, allowing traffic on the LAN to use routable IPs rather than NAT?

If clients are routing traffic via fe80, then you'd still need to be doing some form of NAT in the gateway, which defeats the whole purpose of getting a large prefix!

Nonetheless, I don't believe this is in any way relevant to my problem. Even if there were no delegated prefix (and the ISP issued only a single full /64), the problem of the router itself not having any routing table entries for public IPv6 addresses would remain. :-/
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 20:07    Post subject: Reply with quote
OK, you're right about the default route. And after a reboot I have

Code:

default via fe80::8a43:e1ff:feca:733f dev vlan2  metric 1024  expires 0sec


Clearly I don't know anything about IPv6. Sigh. Old dogs. Wink

Anyway, I suspect after some period of time that will vanish from the routing table. Let's see...
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Apr 22, 2018 20:30    Post subject: Reply with quote
The link local addresses works like gateway address in IPv4. The client sends the packet to the router by link local address to have it routed.

Can you ping6 a host from the router?

For clients to get an IPv6 address, you have to set up dnsmasq.
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 21:08    Post subject: Reply with quote
When it's working, yes. Smile I configured dnsmasq (as you suggested) and it works for clients, too.

But now (~30 minutes later) that route is missing from the IPv6 routing table and (as expected) it's not working.

It looks a bit similar to this: https://rsalveti.wordpress.com/2016/07/27/netgear-r7000-dd-wrt-ipv6-and-the-lack-of-a-stable-gateway/. Unfortunately I don't have a spare USB drive so I can't install ipkg and tcpdump on the router to debug...
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Apr 22, 2018 21:18    Post subject: Reply with quote
I have "prefix ::/48 infinity;" and have had the same IPv6 prefix address for several years.

Isn't tcpdump included in the build? How much flash do the router have?
Is included in both of mine which have more than 32M.
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Apr 22, 2018 21:54    Post subject: Reply with quote
Yeah, I notice that's not in the default dhcp6c.conf, so I will try that.

tcpdump is not in the build. The Dir-882 is quite low on flash--only 16MB.
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Tue May 01, 2018 9:19    Post subject: Reply with quote
Hmm. One more question, because this would make debugging a lot easier:

Shouldn't "dhcp6c -D -T LL" log a fair amount of the DHCP request and response to syslog? I see _nothing_ from dhcp6c in syslog. Bug? Does Busybox dhcp6c not support logging?
MV_ddwrt19
DD-WRT Novice


Joined: 23 Feb 2019
Posts: 10

PostPosted: Sun Feb 24, 2019 2:27    Post subject: Reply with quote
Reviving an almost a year old thread, but was this ever resolved? I'm experiencing the exact same issue

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318815
md2020
DD-WRT Novice


Joined: 22 Apr 2018
Posts: 9

PostPosted: Sun Feb 24, 2019 15:22    Post subject: Reply with quote
I no longer have this problem. I frankly stopped paying attention to it, and noticed--some time and some firmware updates later--that it appeared fixed.

I suspect my ISP changed something, and that this had nothing to do with the firmware version, but I have not bothered to A/B test to confirm.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum