Will's Blog » IPv6 in 10 Minutes: OS X

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).

Our ISP (TWC) does not currently offer native IPv6, or a tunneling technology such as 6RD, or static 6in4 tunnels.

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.

  1. Create an account at tunnelbroker.net.
  2. 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:

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:

Server IPv6 Address: 2001:470:7:ffff::1/64

Client IPv4 Address:

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.

nano /etc/rc.local

#IPv6 start up script - see http://willscorner.net/?p=63
ifconfig gif0 tunnel
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
exit 0

Edit the rtadvd configuration. This handing the router advertisement. We will be advertising the first /64 of our /48.
2001:470:abcd:0::/64 < Only using range for now.
> 2001:470:abcd:1::/64
> 2001:470:abcd:3::/64
nano /etc/rtadvd.conf


The last thing to is execute the start up script via terminal.

sudo bash -v /etc/rc.local
ping6 ipv6.google.com

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.

Posted on February 22, 2011 at 4:24 pm by Will · Permalink
In: ipv6

Leave a Reply