PREFIX=$(printf "2002:%02x%02x:%02x%02x" $(echo MYIP_EXTERNAL | tr "." " ") ) /etc/network/interfaces: [[!format txt """ up ip tunnel add tun6to4 mode sit ttl 64 remote any local MYIP_LOCAL up ip link set dev tun6to4 up up ip -6 addr add $PREFIX::1/16 dev tun6to4 up ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 up ip -6 route add $PREFIX:0107::/64 dev local down ip -6 route del $PREFIX:0107::/64 dev local down ip -6 route flush dev tun6to4 down ip link set dev tun6to4 down down ip tunnel del tun6to4 """]] [[!tag CategoryCodeSnippets]]