Skip to content

Instantly share code, notes, and snippets.

@vuryleo
Created May 11, 2013 16:44
Show Gist options
  • Save vuryleo/5560555 to your computer and use it in GitHub Desktop.
Save vuryleo/5560555 to your computer and use it in GitHub Desktop.
isatap script for THU
#!/bin/sh
LAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
WAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
#LAN_IP=59.66.0.0
#WAN_IP=59.66.0.0 # replace with your wan ip
# just for Tsinghua's ISATAP router
echo $LAN_IP
route delete -inet6 default
/sbin/ifconfig gif0 tunnel $LAN_IP isatap.tsinghua.edu.cn
/sbin/ifconfig gif0 inet6 2402:f000:1:1501:200:5efe:$WAN_IP prefixlen 64
/sbin/route add -inet6 default 2402:f000:1:1501::1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment