![]() |
|
| Daemon News Ezine | BSD News | BSD Mall | BSD Support Forum | BSD Advocacy | BSD Updates |
6to4 IPv6 Explained, or: Flogging a Dead Horseby Hubert Feyrer <hubert@feyrer.de>
What is it?6to4 is an easy way to get IPv6 connectivity for hosts that only have an IPv4 uplink. It can be used with static as well as dynamically assigned numbers, e.g. as found in modem dialup scenarios. When using dynamic v4 addresses, note that a dynamic change of IP numbers will be a problem for incoming traffic, i.e. you can't run persistent servers.
Where to get IPv6 address spaceThe setup on your side doesn't exist on a single IPv6 number, but on a whole /48 network. The address prefix "2002:" is reserved for 6to4 based addresses (i.e. v6 addresses derived from IPv4 addresses). The next 32 bits are your IPv4 address. This results in a /48 network that you can use for your very own purpose. It leaves 16 bits of space for 216 IPv6 subnets, which can take up to 264 nodes each (that's, um ... a BIG number :-). Thanks to the 6to4 prefix and your worldwide unique IPv4 address, this address block is also unique, and it's mapped to you. Image #1 shows an example of how the IPv6 address is built for the IPv4 number 62.157.9.98. The lower bits ":0001::1" were chosen arbitrarily by me, they can contain other values. (e.g. EUI-64 addresses if you choose to setup address autoconfiguration via router solicitation - see rtsol(8) for more information).
How to get connectedIn contrast to the classic "v6 over v4 tunnel" setup, you do not register at a 6bone-gateway, which will then forward you any v6 traffic (encapsulated in v4). Instead, as your IPv6 address is derived from your IPv4 address, any answers can be sent through your nearest 6to4 gateway to you. Unencapsulation of the package is done via the stf(4) network interface, which also forwards the resulting v6 package then according to your routing setup (in case you have more than one machine connected on your 6to4 assigned network). For sending out v6 packets, the stf(4) packet will take the v6 packet, and encapsulate it into a v4 packet. You still need a 6bone-connected 6to4-gateway that will unencapsulate your packets, and forward them to the 6bone. Image #2 tries to illustrate this. Your private network is on the left; the uplink in this case is via a v4-connected PPP-link, and the machine on the right is the 6to4 gateway which is connected to the 6bone.
Security ConsiderationsIn contrast to the "tunnel" setup, you usually can't setup packet filters to block 6to4-packets from unauthorized sources, as this is exactly how (and why) 6to4 works at all. As such, malicious users can send packets with invalid/hazardous IPv6 payloads. See the stf(4) manual page for common configuration mistakes intercepted by default, and for further advice on filtering.
ConfigurationThe following commands are valid for NetBSD 1.5, but as they don't use any "magic" variables from the OS-specific startup system, this should be widely usable. You need to know the following values:
Actual configuration consists of three steps:
After these steps, you are connected to the IPv6-enabled world - congratulations! If you have a permanent IPv4 address, you can put these two commands into /etc/netstart.local to configure IPv6 on each bootup.
GatewayThere's a list of known working 6to4 gateways at http://www.kfu.com/~nsayer/6to4/. In tests, only 6to4.kfu.com and 6to4.ipv6.microsoft.com were found to be working. Cisco has another one that you have to register to before using it, see http://www.cisco.com/ipv6/. There's also an experimental 6to4 server located in Germany, 6to4.ipv6.fh-regensburg.de.
Further reading
|