What's new

r7800 dhcp6s configuration

  • 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!

HELLO_wORLD

Very Senior Member
Hello all,
Hope you have a wonderful summer.

I realized my IPv6 connectivity was not optimal due to failed dad on the WAN global IPv6 (the one given by ISP).
I fixed it by deleting the route, changing sysctl net.ipv6.conf.brwan.accept_dad to 0 (from 3), then recreating the route.

On my LAN side, the devices are attributed IPv6 addresses from dhcp6s.
I would like to tweak the configuration file (/tmp/dhcp6s.conf) to attribute fixed IPv6 to some devices.

Default conf file is:
Code:
option domain-name-servers fe80::bea5:xxxx:xxxx:xxxx;
interface br0 {
        allow rapid-commit;
        address-pool pool_netgear 600 900;

};
pool pool_netgear {
        range 2a03:4980:xxxx:xxxx::2 to 2a03:4980:xxxx:xxxx::40;
};
And the clients do get attributed IPv6 within the range, but there is no reservation so device IPs are changing over time.

I tried to use:
Code:
host hostname {
};
Globally or within interface scope, with several settings like in within like:
Code:
hardware ethernet xx:xx:xx:xx:xx:xx;
Or
Code:
host-identifier option
        dhcp6.client-id CLIENT_DUID_HERE;
Or
Code:
duid CLIENT_DUID_HERE;

And
Code:
fixed-address6 2a03:4980:xxxx:xxxx::160 infinity;
Or
Code:
address 2a03:4980:xxxx:xxxx::160 infinity;

But each time, dhcp6s refuses to start, probably not liking the syntax or not supporting these options.
If I have an empty host hostname { }; in the configuration file, it launches, so it recognizes that part, but the rest is causing it to fail launching.

How can I define an IPv6 address reservation on the LAN side?

Thank you
 
  • Like
Reactions: KW.
you can't. dhcp6s is horribly outdated on NG routers
 
you can't. dhcp6s is horribly outdated on NG routers
Thanks

So, plan B: using Entware dhcpd -6
How could I substitute dhcp6s by dhcpd? I mean where is the script calling « /usr/sbin/dhcp6c -c /tmp/dhcp6c.conf -3 brwan » ?
Is it in one of the init.d scripts?

Also suggestion to @Voxel : having a more recent version of dhcp6s if possible.
 
where is the script calling « /usr/sbin/dhcp6c -c /tmp/dhcp6c.conf -3 brwan » ?
do you mean to look for the script that starts dhcp6c or dhcp6s?

anyways, I'd use this method to find which scripts do something with /usr/sbin/dhcp6s:
Code:
cd /rom
grep -ir "/usr/sbin/dhcp6s"
(or if you what to search in some of the modifications kamoj's addon has made do the grep in /overlay)
(if you'd grep in /, then it would also search in /proc and a few other folders it shouldn't look into. And this usually causes the router to reboot)
 
do you mean to look for the script that starts dhcp6c or dhcp6s?

anyways, I'd use this method to find which scripts do something with /usr/sbin/dhcp6s:
Code:
cd /rom
grep -ir "/usr/sbin/dhcp6s"
(or if you what to search in some of the modifications kamoj's addon has made do the grep in /overlay)
(if you'd grep in /, then it would also search in /proc and a few other folders it shouldn't look into. And this usually causes the router to reboot)
Yep, and found it: etc/net6conf/6service
Thank you, I was leery to search globally on router as it caused problems in the past (looking in those /proc directories). The /rom way is great and fast.
Tomorrow I will mess with /opt/sbin/dhcpd (I was able to install and launch with basic conf for some reservation, but did not test.
Once it is ok, I will change that 6service script to use dhcpd instead of dhcp6s.
I will share here my success (or not) for whomever it would help.
 
So, here is what I did for now:
In /etc/net6conf/6service
Code:
start_dhcp6s() {
        local DHCP6S_ENABLE=`$CONFIG get ipv6_dhcps_enable`
        local OLD_DHCP6S_ENABLE=`$CONFIG get old_ipv6_dhcps_enable`
#       echo "start dhcp6s"
        echo "start dhcpdv6"
#       if [ "x$DHCP6S_ENABLE" = "x1" ]; then
#               /usr/sbin/dhcp6s -3 -c "$DHCP6S_CONF" "$bridge"
#       else
#               /usr/sbin/dhcp6s -3 -c "$DHCP6S_CONF" -i "$bridge"
#       fi
        /opt/sbin/dhcpd -6 -cf /mnt/optware/dhcpd6.conf "$bridge"

        if [ "x$OLD_DHCP6S_ENABLE" = "x" ]; then
                $CONFIG set "old_ipv6_dhcps_enable=$DHCP6S_ENABLE"
        fi

        # SPEC DHCPV6 SERVER:
        # (8)   When the DHCP server function is changed from enabled to disabled or from disabled to enabled,
        #       an implementation MUST pull-down the Ethernet PHY of LAN for 3 seconds and pull it back to high.
        #       This is to force LAN PC's to re-acquire their IPv6 assignments.
        if [ "x$DHCP6S_ENABLE" != "x$OLD_DHCP6S_ENABLE" ]; then
                echo -n 3 > /proc/switch_phy
                $CONFIG set "old_ipv6_dhcps_enable=$DHCP6S_ENABLE"
        fi
}

stop_dhcp6s() {
#      killall dhcp6s
        killall dhcpd
}
/mnt/optware/dhcpd6.conf being my customized config file for dhcpd

It works.

Independently of any of this, since it is about my IPv6 setup and encountered problems, precise that I had to mess with dhcp6c on the WAN side as I could not acquire properly my IPv6 from ISP.
In had to change in/etc/net6conf/6proc
Code:
echo 3 > /proc/sys/net/ipv6/conf/${WAN}/accept_dad
By
Code:
echo 0 > /proc/sys/net/ipv6/conf/${WAN}/accept_dad

And it solved the problem.
I am thinking of doing the same trick as I did for my IPv4 and have static routes and IPv6 WAN setup and launch some dhcpcv6 with a cron regularly to keep the authorization from ISP (I get a fixed IPv6 and /64 range from them).
 
  • Like
Reactions: KW.
In /etc/net6conf/6service I had to adapt the reload function:
Code:
reload() {
        PID_file=/var/run/6service.pid
        test -f $PID_file && {
                kill $(cat $PID_file)
                echo "stop previous service reload process"
        }
        echo "$$" > $PID_file

        touch $SRVC_RELOAD_FILE
        write_config

        #make dhcpv6 server apply the new config file
        echo "6service reload now"
#       /usr/sbin/dhcp6ctl -S reload
        stop_dhcp6s; start_dhcp6s
        #make radvd apply the new config file
        killall -SIGHUP radvd
        rm -f $SRVC_RELOAD_FILE
        rm -f $PID_file
}

And also in /etc/wide-script I had to adapt:
Code:
if ps | grep 'dhcpd -6' | grep -v grep >&- 2>&- ; then
                echo "dhcpv6 server is running, reload dhcp6s config file !"
                /etc/net6conf/6service reload
        fi
 
Overtime, I realized that I needed to change script in /etc/init.d/net-lan as well as it can change DAD. Change is similar to the one made to 6service script.

I was not satisfied with my IPv6 on the LAN side, as my iPad was sometimes reachable with IPv6, sometimes not, and started to play with radvd config file. I fond working settings and changed some lines in 6service to launch radvd with my own setting file.

Now, I have stateful IPv6 with reservation IPv6 for pertinent devices, and dynamic for the others.
The only thing is my Samsung phone that is only getting IPv6 through SLAAC stateless, so it is not getting it for now. I don’t know yet how I can enable SLAAC only on one specific device if possible.

Anyway, all of that to mention that IPv6 is terrible on R7800 (bins are outdated), but it can be arranged with manual tweaks and Entware.

PS: I installed a more recent radvd through Entware (v2.18. vs v1.5 on firmware), but it always create 2 running processes and it crashes after a while. I am using firmware one for now with custom settings.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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