#! /bin/sh ### BEGIN INIT INFO # Provides: ipv6 # Required-Start: $local\_fs $all # Required-Stop: $local\_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the ipv6 tunnel # Description: ipv6 tunnel start-stop-daemon ### END INIT INFO # /etc/init.d/ipv6tb touch /var/lock/ipv6tb case "$1" in start) echo "Starting ipv6tb " setsid /path/to/tb\_userspace tb SERVER\_IPV4\_ADDRESS CLIENTS\_IPV4\_ADDRESS sit > /dev/null 2>&1 & sleep 3s # ugly, but doesn't seem to work at startup otherwise ifconfig tb up ifconfig tb inet6 add CLIENTS\_IPV6\_ADDRESS # Add as many of these as you need from your routed /64 allocation ifconfig tb mtu 1480 route -A inet6 add ::/0 dev tb route -A inet6 del ::/0 dev venet0 ip -6 route del default dev venet0 ;; stop) echo "Stopping ipv6tb" ifconfig tb down route -A inet6 del ::/0 dev tb killall tb\_userspace ;; \*) echo "Usage: /etc/init.d/ipv6tb startstop" exit 1 ;; esac exit 0