1 #!/bin/sh /etc/rc.common
10 config_load
/var
/state
/network
12 config_get LAN lan ifname
13 config_get tnlifname
"$section" tnlifname
14 config_get remoteip4
"$section" remoteip4
15 config_get localip4
"$section" localip4
16 config_get localip6
"$section" localip6
17 config_get prefix
"$section" prefix
19 ip tunnel add
$tnlifname mode sit remote
$remoteip4 local $localip4 ttl
255
20 ifconfig
$tnlifname up
21 ip addr add
$localip6 dev
$tnlifname
22 ip route add
::/0 dev
$tnlifname
23 ip route add
2000::/3 dev
$tnlifname
24 ip
-6 addr add
$prefix dev
$LAN
32 config_load
/var
/state
/network
34 config_get LAN lan ifname
35 config_get tnlifname
"$section" tnlifname
36 config_get remoteip4
"$section" remoteip4
37 config_get localip4
"$section" localip4
38 config_get localip6
"$section" localip6
39 config_get prefix
"$section" prefix
41 ip
-6 addr del
$prefix dev
$LAN
42 ip
-6 ro del
2000::/3 dev
$tnlifname
43 ip
-6 ro del
::/0 dev
$tnlifname
44 ip addr del
$localip6 dev
$tnlifname
45 ifconfig
$tnlifname down
46 ip tunnel del
$tnlifname
49 if ! [ -f /proc
/net
/if_inet6
]; then
50 echo "IPv6 not enabled, install kmod-ipv6";
53 if ! [ -x /sbin
/ip
]; then
54 echo "ip is required to setup the tunnel";
58 config_foreach start_service
6tunnel
63 config_foreach stop_service
6tunnel