I noticed in Owen DeLong's Linux Administration slides
that using /etc/network/interfaces was not supported in Debian, but I wanted to provide a simple example of how it can be done. Here is the configuration I'm using in /etc/network/interfaces:
iface he-ipv6 inet6 v4tunnel
You can grab the necessary fields from the Linux-route2 configuration instructions, eg. here are mine so you can see how they map.
ip tunnel add he-ipv6 mode sit remote 188.8.131.52
local 198.51.100.164 ttl 255
ip link set he-ipv6 up
ip addr add 2001:db8:0f10:99d::2
/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr
The remote address is the endpoint address in the interfaces file and the IPv6 address is the interface address. The gateway is not listed in the Linux-route2 instructions, but can be found on your tunnelbroker.net Tunnel Details page, listed as "Server IPv6 address". It is the same as your IPv6 address, but ending in ::1 rather than ::2.
Once you've put those entries in your /etc/network/interfaces, run ifup he-ipv6
to enable the tunnel.DNS
To use HE's IPv6-whitelisted DNS servers, add the following line to your tunnel configuration in /etc/network/interfaces, right after the "gateway" line:
dns-nameservers 2001:470:20::2 184.108.40.206
If you're concerned about the possibility of tunnel connectivity problems (eg. you have a dynamic IPv4 address), consider leaving out the IPv6 address, because the IPv4 address will still be accessible if your tunnel is down.
To apply the new DNS servers, run ifdown he-ipv6; ifup he-ipv6
- You can specify the local IPv4 endpoint address, but it's not necessary in most setups. In particular if you have protocol 41 forwarded to your machine (eg. by a home router) then you must not include the "local" option.
(Edit: Changed my IP addresses to be in documentation subnets. Endpoint (he.net) IP address retained in case it helps people recognize it.)
(Edit 2: Used the "gateway" option instead of post-up and pre-down "route -6" commands.)
(Edit 3: Removed the "local" address as it's not necessary. Added DNS section.)