Welcome to Joyrex

Native IPv6 on Smelly Black Dog (SBD) ISP with FreeBSD

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:

  1. # cd /usr/src/usr.sbin/rtadvd
  2. # cp rtadvd.c rtadvd.c.orig
  3. # vim rtadvd.c # or whatever your fave editor is
  4. <comment out lines 1700->1724, inclusive>
  5. <save and close the file>
  6. make
  7. 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.

 

Cloud Talk / BarCamp

Today I did a talk for BarCampGeelong.  It was called "THE CLOUD (An Intro With a Slight Deakin Focus)".  It covered how I saw 'the cloud', some of the components and types of clouds, as well as the types of services in a cloud.  It then finished up with an overview of where Deakin is in the cloud world (again, in my view), and where we'd end up going.

Slides are here.

BarCampGeelong was an interesting (good) experience.  It was my first BarCamp experience, and I really didn't know what to expect.  I had read about how it was an 'unconference', and everyone who goes is expected to participate in some way (generally with a 20-30min presentation).  I also believed it was largely web-dev focused.  This made it extremely difficult for me to come up with a presentation.  I tried to come up with something that I could talk somewhat confidently about, while having it be of interest to webdevs, and to varying levels of technicality.  I started writing a talk about virtualisation and how it works, but decided to move on to the concept of the cloud.  I also believed that due to the web-dev focus, the other presentations weren't going to be of interest to me.  Basically, I believed I was going largely to support a local effort to have an IT conference, even if the specific area of IT wasn't my cup of tea.

Going to BarCampGeelong/presenting/attending presentations/meeting people changed my whole view.  There were definitely web-devs there, but there was also quite a few sysadmins.  In fact, at the after drinks, five of the first six people there were sysadmins or ex-sysadmins... although that may just be saying something about sysadmins.  Either way, there was a wide range of topics covered (wider than I expected), with everything from hardware hacking (aurdino-based creations) to drupal.  There was plenty of new stuff to see, and new technologies and projects to get excited about.  My talk may have been too high-level, but it went OK (in my opinion).  It was good practice, at the very least.

In the future, I'm going to try and attend other similar conferences or meetups.  It was well worth the time, and fun in general!