What's new

IPv6 Custom DNS Not Being Set (Correctly)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

labro

Occasional Visitor
Hello,
I'm running a N66U with Merlin 378.55. I've set the router to handle IPv6 from the ISP and I have a few scripts to bring up a ULA address for internal traffic (such as dns, or finding a device when ipv6 range changes).

Assigning the address on the router works alright, but there is some strangeness. Ideally, I need the address setup right before dnsmasq is activated - since dnsmasq will send out RA/DHCPv6 for all address configured on the interface its using (br0).

I have this combination script setup:

dhcpc-event:
Code:
#!/bin/sh

# two functions to call when needed
_noaddress(){
        /usr/sbin/ip -6 addr add fdbe:beef:cafe::1/64 dev br0
        ip -6 addr add fdbe:beef:cafe::1/64 dev br0
        logger "ULA IPv6 Address fdbe:beef:cafe::1/64 not found.. Adding"
}
_addressfound(){
        logger "ULA IPv6 Address fdbe:beef:cafe::1/64 found.. Skipping"
}

# check to see whether we need to update or just ignore any logging

DHCP Event Trigger:
case "$1" in
"start")
    continue
    ;;
"bound")
    continue
        ;;
"renew")
    continue
        ;;
"deconfig")
    continue
    ;;
"internal")
    continue
    ;;
*)
    exit 1
    ;;
esac

# run our script

logger "Triggering: DHCPC Event / Status Change"
# this is a bit weird, but if it is true, then we have an address, otherwise we don't
/usr/sbin/ip addr show dev br0 | /bin/grep -q "beef:cafe" && _addressfound || _noaddress

And dnsmasq.postconf:
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

/jffs/scripts/dhcpc-event internal

logger "Triggering: Starting DNSMasq Reconfiguration"

pc_replace "dhcp-option=lan,option6:23,[::]" "dhcp-option=lan,option6:23,[$(nvram get ipv6_dns1)]" $CONFIG

This setups the configuration as expected (although for some reason the ip address doesn't come up or stick).
However on my Windows systems the DNS Server is listed as my ISP's assigned IPv6 Range and the ip of the router.

How do I get the router to stop assigning its self as a dns server and just use the provided ULA address for DNS Lookups?

Thanks. Also I am happy to provide additional configuration information as needed.
 
Anyone have any idea how to get the DNS to work on a 3rd party DNS server instead of the router acting as DNS?
 
Well looking at your dnsmasq.postconf, it looks like you're setting the router as the DNS as [::] means the global address of the router. Assuming that you want to use a separate DNS, you would need the put the ULA address of your DNS in brackets [fdbe:etc...] in place of [::]. While NVRAM could do that, if your address is static, you don't really need to find it inNVRAM.
 
I thought pc_replace replaced the [::] option leaving nvram 1 setting as the only dns server?
 
I think that your problem is that the address string does not get expanded when using pc_replace. Instead, just the "nvram get ipv6_dns" gets entered as I've just quoted, rather than the fdbe address you're trying to enter. When you look at /etc/dnsmasq.conf looks like the in the quotation marks only. If you put your address here, it should work.

If you set a variable my_address=`nvram get ipv6_dns` (I think) and use $my_address it might work.

I would run it through a few tests with echo $my_address to see if it is working the way you want.
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top