BSD DevCenter
oreilly.comSafari Books Online.Conferences.


IPv6, Meet FreeBSD
Pages: 1, 2

Configuring Your Gateway Machine

Feel free to skip this section if you're only running IPv6 on one host.

Otherwise, make sure you got a /48 address (shown as TSP_PREFIXLEN 48 in the output of -- tspc), and confirm your gateway is configured as such, discussed above.

First assign IPv6 addresses to your gateway interface(s). On my home network, I run both wireless and wired networks. The wireless interface's address is 3ffe:b80:447:77::1, while the wired NIC is 3ffe:b80:447:2::1.

You'll now need to configure rtadvd, the router advertisement daemon--the program that allows autoconfiguration of your clients (a bit trickier at first, but much easier than manual in the long run). The file is in printcap format--you've been warned. Let's look at an example /etc/rtadvd.conf:

#   :addrs#1:\
#   :addr="3ffe:0b80:0447:0001::":prefixlen#64:tc=ether:

Simple enough, really. ep0 is the external interface. Unless you want to run BGP4+ (way beyond this article's scope), you won't want to advertise your routes on the external interface. So we turn to wi0, the wireless gateway device. The first line, addrs#1, tells rtadvd that the interface has only one IPv6 prefix. (Note that if you have more than one prefix for the device, read rtadvd.conf's man page, as that's also a bit beyond this article.) The next line's addr="3ffe..." obviously specifies what the interface's prefix is. Your prefixlen# will almost always be 64, and tc will be ether. More options and details are discussed in the rtadvd.conf man page.


Related Reading

By Paul Albitz, Cricket Liu

Add a line for each interface on which you want to advertise routes. Check and double-check your configuration, and start daemon. In the command line, specify the interfaces that should advertise routes--for the above example:

rtadvd -d wi0

At this point, you should make some changes to your rc.conf file, to keep your changes around after a reboot. A quick look at the new settings:

ifconfig_wi0_alias0="inet6 3ffe:b80:447:77::1 prefixlen 
ifconfig_ep0_alias0="inet6 3ffe:b80:447:1::1 prefixlen 64"

Client Settings

Thanks to the route advertisement daemon running on your gateway, client configuration is a cinch. Simply add the following lines to your rc.conf file:


Bada-bing, you're client is ready to use IPv6. Reboot, and you're on your way. If you already have IPv6 enabled on the client, but the interface isn't configured, don't reboot--just run rtsol [interface_id].

Related Articles:

IPv6: An Interview with Itojun -- Hubert Feyrer interviews Jun-ichiro "itojun" Hagino, one of the core IPv6 developers involved with the KAME project.

Introduction to IPv6 -- You have been told the Internet is running out of IP addresses and all your friends say NAT is the answer, but what is IPv6 and how is it different from what you are using now?


The last topic, and a biggie. If you run a DNS server, you'll likely want to add forward and reverse lookups for your IPv6 address space.

Forward lookups are, of course, the simplest. Just add AAAA records for your IPv6 addresses in the appropriate zone files. For example, in my zone file, I can simply add an AAAA record for my new IPv6 gateway:

post            IN      AAAA    

Setting up reverse DNS is a bit more complicated. You need create and load a new zone file. Demonstrated is the zone file, named, for the 3ffe:b80:447/48 prefix:

; IPv6 reverse zone
; Prefix 3ffe:b80:447/48

@       IN      SOA (
                               2001122601      ; serial
                               3H              ; refresh
                               15M             ; retry
                               1W              ; expiry
                               1D )            ; minimum
       IN      NS

; Our host address
; 3ffe:0b80:0447:0001:0000:0000:0000:0001

; Origin prefix, 48 bits

; Hosts section         in ptr  post.ipv6.radioactivedata.or

Bind must then be configured to use serve the new zone, by adding the following lines to named.conf:

 zone "" {
        type master;
        file "";

Now it's just the small matter of adding the following line to your tspc.conf file, to get Freenet6 to delegate the reverse lookups to your DNS server:

The client is then rerun, and after a few minutes, reverse lookups for the 3ffe:b80:447/48 prefix are delegated to

To check for proper deligation, do a reverse lookup:

dig ptr

Yep, it's a bit lengthy (it would be on all one line), but you hopefully won't have to do that manually too frequently.

To apply this example to your prefix, simply change the IP addresses, hostnames, and the zone filename, and follow the outlined steps.

Rerun the client, wait a few minutes, and perform a reverse lookup. You'll be happy to see that you're now serving IPv6 forward and reverse lookups!


Congratulations! Having worked through the steps outlined above, you're now connected to the ultra-cool IPv6 testbed network! You're an early adopter, a pioneer in the new Internet. Enjoy it.

Shortly, I'll follow up this article with an article on how to set up an IPv6-only network--yep, no IPv4 needed! I'm writing this article on a laptop with no IPv4 address, and it's pretty cool.

Mike DeGraw-Bertsch is a security and Unix system administration consultant in the Boston, Mass. area. When he's not at a job, writing, hacking with Perl, or playing with his wireless network, he can usually be found playing goal in ice hockey.

Return to the BSD DevCenter.

Sponsored by: