Friday, January 14, 2011

Setup HE IPv6 Tunnel in Ubuntu Linux

Script to build the tunnel:

jemurray@glock:/etc$ more /etc/init.d/he6tunnel.sh

#!/bin/bash

## Setup the Tunnel Dynamic IP
/usr/bin/wget --no-check-certificate https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO\&pass=MY-MD5-PASSWORD-GOES-HERE\&user_id=MY-CUSTOMER-ID-GOES-HERE\&tunnel_id=41636

## Setup the Linux proto41 tunnel
/sbin/ifconfig sit0 up
/sbin/ifconfig sit0 inet6 tunnel ::209.51.181.2
/sbin/ifconfig sit1 up
/sbin/ifconfig sit1 inet6 add 2001:470:1f10:2cc::2/64
/sbin/route -A inet6 add ::/0 dev sit1

## Route the static block
/sbin/route -A inet6 add 2001:470:1f11:2cc::/64 dev eth0

## Setup first IP on eth0 interface
/sbin/ifconfig eth0 inet6 add 2001:470:1f11:2cc::1/64


Setup RADV to hand out IPv6 addresses to clients:

jemurray@glock:/etc$ cat /etc/radvd.conf
interface eth0 {
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
# prefix 2001:4978:268::/64 {
prefix 2001:470:1f11:2cc::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
AdvPreferredLifetime 20;
AdvValidLifetime 30;
};
RDNSS 2001:470:1f11:2cc::1 {
AdvRDNSSLifetime 20;
};
};



Client:

jemurray@kimber:~ $ ifconfig en1
en1: flags=8863 mtu 1500
ether 00:1c:b3:ba:e3:f9
inet6 fe80::21c:b3ff:feba:e3f9%en1 prefixlen 64 scopeid 0x6
inet6 2001:470:1f11:2cc:21c:b3ff:feba:e3f9 prefixlen 64 autoconf
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
media: autoselect
status: active



jemurray@kimber:~ $ ping6 ipv6.google.com
PING6(56=40+8+8 bytes) 2001:470:1f11:2cc:21c:b3ff:feba:e3f9 --> 2001:4860:b007::63
16 bytes from 2001:4860:b007::63, icmp_seq=0 hlim=56 time=135.405 ms
16 bytes from 2001:4860:b007::63, icmp_seq=1 hlim=56 time=33.788 ms
16 bytes from 2001:4860:b007::63, icmp_seq=2 hlim=56 time=33.910 ms
^C
--- ipv6.l.google.com ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 33.788/67.701/135.405/47.874 ms



No comments:

Post a Comment

Followers