I originally had Native IPv6 going on FreeBSD when I was with Internode (using MavEtJu's incredibly helpful guide, with some modifications). Going to SBD, it didn't work.. and took some more messing around. Here are my current (fully working) settings with SBD (who I highly recommend by the way. Their service is amazing.) These configuration files reference various ethernet interfaces (emX). You'll have to replace these with your appropriate interfaces. For me, em0 is the interface for my local network, em3 is the interface that's connected to my bridged modem, and tun0 is the ppp interface created when I connect to SBD. Of course, you should replace YOURPHONENUMBER/YOURPASSWORD with the proper values in the ppp.conf as well. On with the config files:
/etc/ppp/ppp.conf:
sbdc:
set authname "YOURPHONENUMBER@ipnetworks.net.au"
set authkey "YOURPASSWORD"
set device PPPoE:em3
disable lqr echo
nat enable yes
set cd 5
set dial
set login
set redial 0 0
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
add default HISADDR # Add a (sticky) default route
add default HISADDR6 # Add a (sticky) default route
set timeout 0
The "add default HISADDR6" line is what is important here. You need to have that in the configuration block for your ppp.conf file.
Once that's done, you should (re)start your ppp connection. You probably won't see much here, as you need dhcp6c to get advertisements from ppp connection. So, install dhcp6c from ports and edit the config file:
/usr/local/etc/dhcp6c.conf
# The followings are a sample configuration for requiring the "stateless"
# DHCPv6 service.
interface em0 {
information-only;
};
# The followings are a sample configuration to be delegated an IPv6 prefix
# from an upstream service provider. With this configuration dhcp6c will
# send solicit messages containing an IA_PD option, with an IAID 0, on to
# an upstream PPP link, ppp0. After receiving some prefixes from a server,
# dhcp6c will then configure derived IPv6 prefixes with the SLA ID 1 on a
# local ethernet interface, ne0. Note that the IAID for the id-assoc
# statement is 0 according to the default.
interface tun0 {
send ia-pd 0;
};
id-assoc pd {
prefix-interface em0 {
sla-id 1;
sla-len 0;
};
};
Again, remember to replace the network interfaces with the ones you actually use. em0 is my internal network interface, and tun0 is the ppp connection. What this configuration does is grab the IPv6 allocation (SBD gives you a standard /64) and assigns an address to your INTERNAL network interface. Note, it doesn't give an IPv6 address to the actual PPP connection, where your IPv4 SBD IP is. This is because IPv6 eliminates NAT (or is supposed to), so the interface you actually talk on gets the IPv6 address. Make sure you have your firewall properly configured for this case :)
Finally, I run another program that has no config file, called rtadvd. I am running FreeBSD 9.0-STABLE, and got bit by this bug, so I had to apply the workaround. To do that:
- # cd /usr/src/usr.sbin/rtadvd
- # cp rtadvd.c rtadvd.c.orig
- # vim rtadvd.c # or whatever your fave editor is
- <comment out lines 1700->1724, inclusive>
- <save and close the file>
- make
- make install
Once I did that, and started rtadvd (passing it my internal interface) it worked perfectly. Clients on my LAN now receive real IPv6 addresses and can talk IPv6. Again, make sure your firewall handles this. There's no NAT firewall inbetween the internal NAT clients and the IPv6 world now.
Voila. Fully working Native IPv6 on SBD using FreeBSD as the ppp/router.
So, here's some of the extra info I've left out:
IPv6 on FreeBSD needs:
/etc/rc.conf
# ppp connection ppp_enable="YES" ppp_nat="YES" ppp_profile="sbd" # ipv6 stuff ipv6_enable="YES" ipv6_gateway_enable="YES" rtadvd_enable="YES" rtadvd_interfaces="em0" dhcp6c_enable="YES" dhcp6c_interfaces="tun0" ipv6_ipv4mapping="YES"
- The ppp section tells ppp to run at startup, and what ppp profile to use
- The first two lines of the ipv6 section make your FreeBSD server enable IPv6 and act as a FreeBSD router.
- The rtadvd software (comes as part of FreeBSD) is the software that allows the other computers on your LAN get IPv6 connectivity. rtadvd_interfaces is the interface you want to re-advertise on (your internal network connection).
- dhcp6c software (in ports) allows you to receive an IPv6 address for your server from your ppp connection. dhcp6c_interfaces is the interface of your ppp connection
Debugging:
- Use ping6 (www.freebsd.org or ipv6.google.com are good addresses to try)
- telnet -6, ssh -6 work as well for IPv6. traceroute6 may be handy, depending on your issue.
- If you have a (graphical) web browser, visit www.kame.net. If you're on IPv6, the turtle will be moving.
- If for some reason you don't get an address when you run dhcp6c, try running it by hand (as root) with the command: dhcp6c -f -d <ppp interface>. This will run in the foreground and output debugging messages. It may be you'll see an error where it complains (number <= 64) + (number) != 64, or something similar. In that case, you want to edit your dhcp6c.conf file, changing the sla-len variable from 0 to whatever needs to be added to the first number to make 64.
- rtadvd -f -d <advertising interface> is how you run rtadvd in the foreground with debugging messages on. It may help you determine why it's not working.