OpenBSD -current IPv6 Router. Clients: #Windows, #Android, #Linux, #Openbsd. Xfinity/Comcast cable internet. Native #IPv6
So this is a follow up article revisiting using native Comcast(Xfinity) internet with your OpenBSD router provide IPv6 connectivity to all of your devices on your LAN. I first attempted this around OpenBSD 5.4, and had moderate success, but there were still some bugs to be worked out. Now that we are up to OpenBSD 6.1, things seem to be much more refined! This has been fully tested through 6.4 and on -current 6.5 snapshots as well.
The router!!
Make sure you add net.inet6.ip6.forwarding=1 # 1=Permit forwarding (routing) of IPv6 packets
to your /etc/sysctl.conf .
pkg_add -v wide-dhcpv6
/etc/dhcpv6.conf (em1 being external, em0 being internal):
interface em1 {
send ia-pd 0;
send ia-na 0;
send rapid-commit;
request domain-name-servers;
request domain-name;
};
id-assoc na 0 {
};
id-assoc pd 0 {
prefix-interface em0 {
sla-len 0;
};
};
/etc/rc.conf.local:
rcctl enable rad
rcctl start rad
sh /home/forgotten/start_ipv6.sh
Create a rad.conf
Copy /etc/examples/rad.conf to /etc.
Simply put your internal LAN interface name in the config:
interface em0
/home/forgotten/start_ipv6.sh:
#!/bin/sh
egress=em1
internal=em0
/usr/bin/pkill dhcp6c
route -qn delete -inet6 default
ifconfig $egress -inet6
/sbin/ifconfig $egress inet6 autoconf
gateway=
while [ -z "$gateway" ]; do
sleep 1
gateway=$( route -qn get -inet6 default | awk '/gateway/ {
print $2 }' )
done
route -qn add -inet6 default $gateway
/usr/local/sbin/dhcp6c $egress $internal
I found this script on Github at the following link, thanks to afresh1 for this work!:
https://gist.github.com/afresh1/274a19b78e8983e0dc9dd4ff1dfd407f
The clients!!
So Windows, Android, and Linux(Ubuntu 17.04) just worked out of the box. They were advertised an IPv6 address and just Autoconf was successful without intervention.
On OpenBSD I had to:
pkg_add -v wide-dhcpv6
/etc/dhcp6c.conf:
interface iwn0 {
send ia-na 0;
send rapid-commit;
send domain-name-servers;
};
id-assoc na {
};
/etc/rc.local
/usr/local/sbin/dhcp6c -c /etc/dhcp6c.conf iwn0
ifconfig iwn0 inet6 autoconf
Here are some screenshots!!
Router / Windows client working:
Android client:
Ubuntu Linux client:
OpenBSD laptop client: