Missing DNS for DHCPv6-PD

Hello,

I live in the Chinese mainland, where ISPs provide services via PPPoE and DHCPv6-PD.

I noticed that OpenWRT doesn't seem to be getting DNS downlinked via DHCPv6-PD: I didn't find IPv6 DNS in /tmp/resolv.conf.ppp.

Even when I fill in the custom DNS, only IPv4 DNS information is shown in Overview, although IPv6 DNS is included in /tmp/resolv.conf.auto.

So that's two problems, one is that OpenWRT is not getting the IPv6 DNS from the ISP, and the other is that OpenWRT is not showing the custom IPv6 DNS I filled out in Overview.

As I use custom DNS and although it doesn't show up in Overview, it is still being used, so it's not a big problem.

It would be nice if these issues could be addressed.

Best regards,
Gentry

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; \
uci export dhcp; uci export firewall; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

I'm actually using ImmortalWrt, a fork of OpenWRT, because the mainline doesn't support my device, the FastRhino R68S. Since the ImmortalWrt policy is to follow the mainline, support more devices and port more packages, I don't think this issue is unique to that fork.

{
        "kernel": "5.15.118",
        "hostname": "ImmortalWrt",
        "system": "ARMv8 Processor rev 0",
        "model": "Lunzn FastRhino R68S",
        "board_name": "lunzn,fastrhino-r68s",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "ImmortalWrt",
                "version": "23.05-SNAPSHOT",
                "revision": "r26701-8a9a8711b2",
                "target": "rockchip/armv8",
                "description": "ImmortalWrt 23.05-SNAPSHOT r26701-8a9a8711b2"
        }
}
package network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd95::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'
        list ports 'eth2'
        list ports 'eth3'

config device
        option name 'eth0'
        option macaddr '…'

config device
        option name 'eth1'
        option macaddr '…'

config device
        option name 'eth3'
        option macaddr '…'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '172.16.0.1'
        option netmask '255.255.0.0'
        option ip6assign '60'
        option ip6ifaceid '::'

config device
        option name 'eth2'
        option macaddr '…'

config interface 'wan'
        option device 'eth1'
        option proto 'pppoe'
        option username '…'
        option password '…'
        option ipv6 'auto'
        option peerdns '0'
        list dns '2402:4e00::'
        list dns '2400:3200::1'
        list dns '119.29.29.29'
        list dns '223.5.5.5'

package dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '8000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option mini_ttl '3600'
        option dns_redirect '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'hybrid'
        option ra 'hybrid'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option ndp 'hybrid'
        option ra_management '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

package firewall

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option flow_offloading '1'
        option flow_offloading_hw '1'
        option fullcone '1'
        option synflood_protect '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        list network 'wan'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include 'miniupnpd'
        option type 'script'
        option path '/usr/share/miniupnpd/firewall.include'

lrwxrwxrwx    1 root     root            16 Jun 27 23:21 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            47 Jun 30 10:13 /tmp/resolv.conf
lrwxrwxrwx    1 root     root            35 Jun 30 08:25 /tmp/resolv.conf.auto -> /tmp/resolv.conf.d/resolv.conf.auto
-rw-r--r--    1 root     root           126 Jun 30 08:25 /tmp/resolv.conf.d/resolv.conf.auto
-rw-r--r--    1 root     root            50 Jun 30 08:25 /tmp/resolv.conf.ppp

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root           126 Jun 30 08:25 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf.auto <==
# Interface wan
nameserver 2402:4e00::
nameserver 2400:3200::1
nameserver 119.29.29.29
nameserver 223.5.5.5
# Interface wan_6

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

==> /tmp/resolv.conf.ppp <==
nameserver 202.96.128.86
nameserver 202.96.134.33

==> /tmp/resolv.conf.d/resolv.conf.auto <==
# Interface wan
nameserver 2402:4e00::
nameserver 2400:3200::1
nameserver 119.29.29.29
nameserver 223.5.5.5
# Interface wan_6

Some privacy parameters I hide using the "…".

With the exception of the hybrid in options ra, dhcpv6, and ndp, everything else looks fine. Server is the best option here.
You have set the option ipv6 into auto, so it auto creates the wan_6 interface.
The IPv6 DNS is usually advertised in the RAs, not in DHCPv6. You can verify if your provider sends them to your router, by capturing the RAs and the DHCP6 packets. If they are not there, there is little you can do and that is to contact them.

1 Like

I previously used an ASUS router and managed to get IPv6 DNS, so I assume this is an OpenWRT issue.

What is the output of ifstatus wan_6 ?

...
"dns-server": [
                        "240e:1f:1::1"
                ],
...

OK, I've found it.

So the question now is why we don't see it in resolv.conf.* and how to fix the problem of IPv6 DNS not showing up in Overview.

Enable peerdns in wan interface and check it again.

None

/tmp/resolv.conf.auto

# Interface wan
nameserver 202.96.128.86
nameserver 202.96.134.33
# Interface wan_6

Tough luck, it works fine on my OpenWrt.

==> /tmp/resolv.conf.d/resolv.conf.auto <==
# Interface wan
nameserver 8.8.8.8
nameserver 1.1.1.1
# Interface wan6
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

I reinstalled the firmware and the problem no longer exists

The question then becomes whether the custom IPv6 DNS configured on the wan interface should be classified as wan_6.
Because the wan_6 interface is a dynamically generated virtual interface, it is not editable.
The IPv6 DNS configured on the wan interface is not shown in Overview.

If you need a customized ipv6 wan interface, change the ipv6 option to 1 in wan and create the wan6 to adjust it to your needs.
Other than that the absence of the additional nameserver in overview is because the wan interface is v4, not v6.
However, as long as the nameservers are inserted in resolv.conf.auto it is the same.

Ok, I understand, we can just manually get the IPv6 address and manually set up the wan6 device as the ppp tunnel interface. Thanks for your help!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.