Created
September 17, 2013 10:43
-
-
Save blahgeek/6592713 to your computer and use it in GitHub Desktop.
ISATAP config for Mac OS X. Works either with or without NAT. (fish script)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/loca/bin/fish | |
function isatap | |
set REMOTE_IP 166.111.21.1 | |
set LINK_PREFIX "fe80::200:5efe" | |
set GLOBAL_PREFIX "2402:f000:1:1501:200:5efe" | |
if sudo ifconfig gif0 destroy | |
echo "Previous gif0 destroyed" | |
end | |
set PUBLIC_IP (curl ifconfig.me) | |
set LOCAL_IP (sudo ifconfig en0 | grep inet | grep -v inet6 | awk '{print $2}') | |
echo "Public IP: $PUBLIC_IP, Local IP: $LOCAL_IP" | |
sudo ifconfig gif0 create | |
sudo ifconfig gif0 tunnel $LOCAL_IP $REMOTE_IP | |
sudo ifconfig gif0 inet6 $LINK_PREFIX:$PUBLIC_IP prefixlen 64 | |
sudo ifconfig gif0 inet6 $GLOBAL_PREFIX:$PUBLIC_IP prefixlen 64 | |
sudo route delete -inet6 default | |
sudo route add -inet6 default $GLOBAL_PREFIX:$REMOTE_IP | |
echo "Done" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment