Adding DHCPv6-PD support to DD-WRT
by geekagent
I got my new buffalo router this week, and surprisingly, no-one had documented how to do DHCPv6 with Prefix Delegation. I managed to get it working so I thought I would document it so others can find it.
Edit: I added a check to make sure dhcp6c is only running once. My router ended up running multiple copies and having them interfere with each other
Steps:
- Set up jffs. You’ll be using it through the rest of these steps
- Copy /usr/bin/ipkg /jffs
- Edit /jffs/ipkg and change
IPKG_DIR_PREFIX=/usr/local/lib/ipkg
to:
IPKG_DIR_PREFIX=/jffs/usr/local/lib/ipkg
- Copy /etc/ipkg.conf /jffs
- Edit /jffs/ipkg.conf and add the following source:
src openwrt-trunk http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages
comment out thewhiterussian
source. - jffs update and install needed packges:
# IPKG_CONF_DIR=/jffs /jffs ipkg update
# IPKG_CONF_DIR=/jffs /jffs ipkg install wide-dhcpv6-client
# IPKG_CONF_DIR=/jffs /jffs ipkg install rdisc6 - Put the following in /jffs/etc/config/dhcp6c.wanup:
#!/bin/sh if [ ! -f /tmp/var/run/dhcp6c.pid ] ; then dhcp6c -c /jffs/etc/dhcp6/dhcp6c.conf -p /tmp/var/run/dhcp6c.pid vlan2 fi
- Put the following in /jffs/etc/config/rdisc6.wanup:
#!/bin/sh
echo 2 > /proc/sys/net/ipv6/conf/vlan2/accept_ra
rdisc6 - Make those scripts executable.
# chmod 755 /jff/etc/config/*.wanup
- Put the following in /jffs/etc/dhcp6/dhcp6c.conf:
interface vlan2 { send rapid-commit; send ia-pd 0; send ia-na 0; request domain-name-servers, domain-name; script "/jffs/etc/dhcp6/dhcp6c-script"; }; id-assoc pd 0 { prefix-interface br0 { sla-id 0; sla-len 0; }; }; id-assoc na 0 {};
- Put the following in /jffs/etc/dhcp6/dhcp6c-script:
#!/bin/sh if [ -f /var/run/radvd.pid ] ; then kill -HUP `cat /var/run/radvd.pid`; fi
- Make dhcp6c-script executable.
- Make sure ipv6 is enabled in the web interface, along with radvd. Put the following as radvd.conf:
interface br0 { AdvSendAdvert on; prefix ::/64 {}; RDNSS 2001:558:FEED::1 2001:558:FEED::2 {}; };
- Replace the nameservers above if this isn’t for comcast. It’s probably possible with a little work to re-write radvd.conf dynamically based on the received dns servers. This works for now.
- Reboot
If you run into an issue following these steps, please contact me. Note that I tried several things first and attempted to distill the results down to instructions. It’s possible that in trying something, I did something relevant that I didn’t record here.
[…] of DHCP, I found another blog post: Adding DHCPv6-PD support to DD-WRT. However, that looks similar to what I previously did with ping6, i.e. you have to install extra […]