Skip to content

Instantly share code, notes, and snippets.

@afresh1

afresh1/start_inet6.sh

Last active May 8, 2020
Embed
What would you like to do?
Find the default IPv6 gateway and start forwarding traffic on OpenBSD and Comcast (XFinity)
#!/bin/sh
egress=$1
internal=$2
# This should set up ipv6 on XFinity or Comcast on OpenBSD 6.1
# Stop everything
/usr/bin/pkill dhcp6c
route -qn delete -inet6 default
ifconfig $egress -inet6
# Turn on autoconf so we can find our default gateway
/sbin/ifconfig $egress inet6 autoconf
# Wait until we get a gateway
gateway=
while [ -z "$gateway" ]; do
sleep 1
gateway=$( route -qn get -inet6 default | awk '/gateway/ { print $2 }' )
done
# Now, add the default gateway statically,
# for reasons I don't understand
route -qn add -inet6 default $gateway
/usr/local/sbin/dhcp6c $egress $internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.