IPv6 in 10 Minutes: OS X
If you have an extra Mac kicking around the house, you can use it as an IPv6 router, provided you keep it powered on all the time. We use our Mac Mini that acts as a home theater PC (Mac).
The best way for us to reach the IPv6 Internet is to use a static 6in4 tunnel to a provider. We use Hurricane Electric’s Tunnel Broker service as it is free, fast, and has good uptime. There are a other 6in4 tunnel providers out there (eg. SixXs). These instructions should work with the exception of the script used to update the IPv4 endpoint.
There are three requirements before we begin. (1) The endpoint must be reachable via ICMP pings. (2) There must be only one layer of NAT (or no NAT). (3) Protocol 41 must be passable. Protocol 41 is not port 41 (port forwarding port 41 will not work). In most cases you will have to set the IPv6 Mac router as a DMZ host.
- Create an account at tunnelbroker.net.
- Create a new tunnel. It is best to go with their choice as that is the lowest latency tunnel server.
In our example, we will use the following information. We will be using NAT for this example. If you were not using NAT, you would just put in your external IP wherever the NAT address is referenced.
Internal IP of Mac router: 192.168.1.152
Ethernet Interface of Mac router: en0
Notice that we are using the same interface as our IPv4 connection. This is doable if you have a CPE device (cable modem, ADSL modem, etc…), or a router that does not pass IPv6. You won’t have to worry about spewing router advertisements back into your ISP’s network. If you are on a dorm network, or a direct ethernet handoff, you will need a second NIC.
(information from tunnelbroker’s tunnel page – you will need to change to reflect your information)
Server IPv4 Address: 18.104.22.168
Server IPv6 Address: 2001:470:7:ffff::1/64
Client IPv4 Address: 22.214.171.124
Client IPv6 Address: 2001:470:7:ffff::2/64
Routed /48: 2001:470:abcd::/48
The next step is to create a startup script on your Mac.
#IPv6 start up script - see http://willscorner.net/?p=63
ifconfig gif0 tunnel 192.168.1.152 126.96.36.199
ifconfig gif0 inet6 2001:470:7:ffff::2 2001:470:7:ffff::1 prefixlen 128
route -n add -inet6 default 2001:470:7:ffff::1
ifconfig en0 inet6 2001:470:abcd::1/64
ifconfig lo0 inet6 2001:470:abcd::/48
sysctl -w net.inet6.ip6.forwarding=1
sysctl -w net.inet6.ip6.accept_rtadv=0
rtadvd -s en0
The last thing to is execute the start up script via terminal.
sudo bash -v /etc/rc.local
The only thing you will need to be concerned about is updating the external IPv4 address with your tunnel provider. Our provider, tunnelbroker.net has a url you can use in a cronjob to issue a endpoint update.
Feel free to ask questions and troubleshoot in the comments.