#!/bin/bash
exec >/dev/console
exec </dev/console
exec 2>/dev/console
PATH=/usr/local/bin:/usr/local/etc:/usr/bin:/bin:/etc; export PATH

# Your IPv6 prefix
PREFIX=
# The host-part of the IPv6 address for this machine
ADDRESS=1
# The IPv4 address of the far side of your tunnel
TUNNEL=

echo 0 > /proc/sys/net/ipv6/accept_ra
echo 0 > /proc/sys/net/ipv6/accept_redirects
echo 1 > /proc/sys/net/ipv6/forwarding

/bin/ifconfig sit0 up

/bin/ifconfig eth0 add $PREFIX::$ADDRESS/80
/bin/route -A inet6 add $PREFIX::0/80 dev eth0

# tunnel to outside
/bin/ifconfig sit0 tunnel ::$TUNNEL
/bin/ifconfig sit1 up
/bin/route -A inet6 add 5f00::0/8 gw fe80::$TUNNEL dev sit1

/etc/radvd &