Skip to content

Instantly share code, notes, and snippets.

@pklaus
Created May 9, 2011 09:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pklaus/962287 to your computer and use it in GitHub Desktop.
Save pklaus/962287 to your computer and use it in GitHub Desktop.
tunnelbroker.net : deprecated tunnel setup on Linux using "ifconfig" and "route"
#!/bin/bash
# Using "ifconfig" and "route" (deprecated)
# <http://tldp.org/HOWTO/Linux+IPv6-HOWTO/conf-ipv6-in-ipv4-point-to-point-tunnels.html>
# You should rather use this one instead (makes use of the tool "ip"): <https://gist.github.com/962408>
# Run like this:
# sudo ./tunnelbroker-net.linux-deprecated.sh
set -x
DEV0="sit0"
DEV1="sit1"
HEIPV4SERVER="::216.66.80.30"
HEIPV6CLIENT="2001:470:1f0a:2abc::2/64"
ifconfig $DEV0 up
ifconfig $DEV0 inet6 tunnel $HEIPV4SERVER
ifconfig $DEV1 up
ifconfig $DEV1 inet6 add $HEIPV6CLIENT
route -A inet6 add ::/0 dev $DEV1
cat << EOF
You set up the tunnel. To remove the tunnel again, run those commands as root:
route -A inet6 delete ::/0 dev $DEV1
ifconfig $DEV1 down
ifconfig $DEV0 down
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment