|
IntroductionYou may not know this, but you already have IPv6 addresses. There is a feature called 6 to 4 which means any IPv4 address can be translated not only into one IPv6 address but many. A 6 to 4 IPv6 address looks like 2002:hhhh:hhhh::1 The hhhh:hhhh is the hexadecimal equivalent of your IPv4 address. How it worksTo explain how this protocol works, imagine you have your computer, a gateway, an IPv6 server and a 6to4 router. You setup a one-way tunnel from your computer to the gateway. This gateway will see IPv6 in IPv4 packets from you and route them normally to the server. The IPv6 server sees a "normal" IPv6 host (yours) and sends the reply. Now the magic! Certain routers out on the Internet understand 6to4 packets, everyone else just sees normal IPv6 packets. These routers advertise routes for either the whole 2002::/16 block or parts of it (for example if they are close to some IPv4 address blocks they may advertise the 6to4 equivalents). Standard ipv6 routers see these advertisements and send your reply to a 6to4 router. The 6to4 router knows this is a special packet, so then creates a IPv6 over IPv4 tunnel to your host and sends the packet. The whole point is, if you can get your IPv6 packets into the IPv6 network somehow, then if you use 6to4 you're connected. Great for dialup users. How to do itFirst, convert your IPv4 address into a 6to4 address. Using bash for address 192.0.2.3:
$ printf "%02x%02x:%02x%02x\n" 192 0 2 3 c000:0203 So I've got the block 2002:c000:0203::/48 to play with, a whole 2^80 addresses, which should be plenty for you. We'll assume you take the first ipv6 address, 2002:c000:0203::1 There is a special anycast address of 192.88.99.1 that is used for the closest 6to4 router. I've used the iproute commands here, but the other ways explained in the general setup page will also work. To set it up:
ip addr add 2002:c000:0203::1/16 dev sit0 ip -6 route add 2000::/3 via ::192.88.99.1 You're done! Make sure you allow ipv6 over ipv4 packets in from anywhere, you don't know who the 6to4 router is beforehand. Please note the 192.0.2.x IP addresses are examples, subsititute your own addresses there. AcknowledgementsMy thanks to Jason Gunthorpe and Marco d'Itri for some of the information about 6to4 and how to set it up. Thanks to Riku Voipio for the heads-up on the 6to4 anycast address. |
||||||||