Created
July 14, 2012 09:09
-
-
Save peaceman/3110152 to your computer and use it in GitHub Desktop.
ipv6 tunnel script
This file contains hidden or 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
| #!/bin/bash | |
| old_ip=$(cat last_ip) | |
| ip=$(dig +short googlerocks.dyndns.org) | |
| echo $ip > last_ip | |
| if [ "$ip" = "$old_ip" ]; then | |
| echo "nothing to do" | |
| else | |
| echo "updating tunnel" | |
| ip tunnel del v6-tunnel | |
| ip tunnel add v6-tunnel mode sit remote $ip local 176.9.43.248 ttl 255 | |
| ip link set v6-tunnel up | |
| ip addr add 2a01:4f8:150:54e3:abcd::1/80 dev v6-tunnel | |
| ip route add 2a01:4f8:150:5ff5::/64 dev v6-tunnel | |
| ip -f inet6 addr | |
| fi | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment