Getting on the IPv6 Net
From Section6wiki
If you have an ipv4 address you can get on the ipv6 network without a tunnel broker by using the 6to4 tunnel Interface. Here's how:
Contents |
Kernel Options
Set the following options in your kernel. Many kernels already have INET6 so just make sure that's in there. The stf device you'll likely have to add manually.
options INET6 device stf # 6to4 IPv6 over IPv4 encapsulation
Edit your /etc/rc.conf/
The following assumes your outside interface is 1.2.3.4. Also the default router below is an anycast address that finds the closest ipv6 router and uses it. Thus anyone can use this defaultrouter address:
ipv6_enable="YES" ipv6_network_interfaces="auto" ipv6_defaultrouter="2002:c058:6301::" stf_interface_ipv4addr="1.2.3.4"
Setting up for an internal network
If you're like a lot of people out there you may also be running a NAT that you want to get on the 6net. Make sure you replace fxp0 with your internal interface and set the following in your /etc/rc.conf:
ipv6_gateway_enable="YES" rtadvd_enable="YES" rtadvd_interfaces="fxp0" ipv6_ifconfig_fxp0="2002:d8fe:10f1:2:1234:56bf:fe78:9abc prefixlen 64"
To get your address to ifconfig above, read the next section...
You'll also have to set up rtadvd, but first you'll have to figure out what your ipv6 network is. You can reboot your machine and stf0 will come up with the network for you, or you can figure it out yourself.
How to translate your address from ipv4 to ipv6
First you'll need to know your ipv6 address derived from your v4 address Here's how:
216.254.16.241
Decimal: 216 254 16 241
Hex: D8 FE 10 F1
Assembled from hex above
|
|-------|
IPv6: 2002:d8fe:10f1::/48
Thus from here you can set up your stf0 interface by using the first ip in your network:
ifconfig stf0 inet6 2002:3ee0:3972::1 prefixlen 16 alias
Assigning an address to your internal interface
- Take your mac address:
12:34:56:78:9a:bc
- Then pick a /64 from your network (a number after the first 4 octets). It can be any number but here we choose 2.
2002:d8fe:10f1:2:
- Then split your mac address in half with ff:fe so you'll get
2002:d8fe:10f1:2:1234:56bf:fe78:9abc
|----------------|-----| |------|
your /64 your mac address
- so you can configure your router's internal interface:
ifconfig fxp0 inet6 2002:d8fe:10f1:2:1234:56bf:fe78:9abc prefixlen 64
Once you have everything here set up you can start your ipv6 network with the following command:
/etc/rc.d/network_ipv6
Configuring rtadvd
This part is easy. Just take the /64 you picked out from above (in this case 2002:d8fe:10f1:2::) and add it to /etc/rtadvd.conf:
ftp0:\
:addrs#1:addr:2002:d8fe:10f1:2::":prefixlen#64:tc=ether:
If you don't want to reboot you can start rtadvd with
/etc/rc.d/rtadvd start
Adding rules to pf.conf
If you're not using a firewall (which you probably should be) you can skip this part, if you're using pf.conf you can add these rules to make sure your packets aren't blocked on the ipv6 net.
############## # IPv6 Rules # ############## pass in quick on stf0 all pass out quick on stf0 all pass out quick proto ipv6 from any to any keep state pass out quick proto ipv6-icmp from any to any keep state pass in quick proto ipv6-icmp from any to any
And reload your rules with
pfctl -f /etc/pf.conf
At thing point you should be able to ping kame.net
ping6 www.kame.net
If this works you're in business!

