#!/bin/sh # Hurricane Electric IPv6 tunnel setup (SIT) # NOTICE: Safety guard - manually comment this line to run: exit 1 # HE tunnel server IPv4 HE_SERVER_IPV4="102.2.3.4" # Your VPS public IPv4 YOUR_VPS_IPV4="202.2.3.4" # Client IPv6 block address (from HE panel) CLIENT_IPV6="2001:470:abcd:1234::2" # Server IPv6 address (from HE panel) SERVER_IPV6="2001:470:abcd:1234::1" # Optional: access SSH from a random IPv6 address (very hard to guess) # By default, this is commented out in the source code. See line ~97. SSH_IPV6="2001:470:abcd:1234::1" # Tunnel name. TUN_IF="he-ipv6" # Amount of subnets on client IPv6. SUBNETS="64" # Apache config files. PORTS_CONF="/etc/apache2/ports.conf" BACKUP_CONF="/etc/apache2/ports.conf.bak" echo "----------------------------" echo "Creating tunnel interface..." ip tunnel del $TUN_IF 2>/dev/null ip tunnel add $TUN_IF mode sit remote $HE_SERVER_IPV4 local $YOUR_VPS_IPV4 ttl 255 sleep 1 ip addr add $CLIENT_IPV6/64 dev $TUN_IF sleep 1 ip link set $TUN_IF up sleep 1 ip -6 route add ::/0 dev $TUN_IF sleep 1 # Backup current config cp $PORTS_CONF $BACKUP_CONF echo "----------------------------" echo "Backup saved to $BACKUP_CONF" # Overwrite ports.conf cat > $PORTS_CONF <