[package] make 6tunnel support a delegated block (#4724)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@20206 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
aeffe82d7f
commit
2be0537b61
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=6scripts
|
PKG_NAME:=6scripts
|
||||||
PKG_VERSION:=0.1
|
PKG_VERSION:=0.1
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -14,3 +14,5 @@ config 6tunnel
|
|||||||
option mtu '1280'
|
option mtu '1280'
|
||||||
# this should provide a ttl for your tunnel interface
|
# this should provide a ttl for your tunnel interface
|
||||||
option ttl '64'
|
option ttl '64'
|
||||||
|
# provide your tunnel provider's delegated block (/64 or /48)
|
||||||
|
option delegatedip6 ''
|
||||||
|
@ -17,13 +17,16 @@ start_service() {
|
|||||||
config_get remoteip6 "$section" remoteip6
|
config_get remoteip6 "$section" remoteip6
|
||||||
config_get ttl "$section" ttl
|
config_get ttl "$section" ttl
|
||||||
config_get mtu "$section" mtu
|
config_get mtu "$section" mtu
|
||||||
|
config_get delegatedip6 "$section" delegatedip6
|
||||||
|
|
||||||
ip tunnel add $tnlifname mode sit remote $remoteip4 local $localip4 ttl 255
|
ip tunnel add $tnlifname mode sit remote $remoteip4 local $localip4 ttl 255
|
||||||
ifconfig $tnlifname up
|
ifconfig $tnlifname up
|
||||||
ip link set mtu $mtu dev $tnlifname
|
ip link set mtu $mtu dev $tnlifname
|
||||||
ip tunnel change $tnlifname ttl $ttl
|
ip tunnel change $tnlifname ttl $ttl
|
||||||
ip addr add $localip6 dev $tnlifname
|
ip addr add $localip6 dev $tnlifname
|
||||||
|
ip -6 route ::/0 dev $tnlifname
|
||||||
ip -6 route add 2000::/3 via $remoteip6
|
ip -6 route add 2000::/3 via $remoteip6
|
||||||
|
ip -6 route add $delegatedip6 dev $LAN
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
@ -41,7 +44,9 @@ stop_service() {
|
|||||||
config_get remoteip6 "$section" remoteip6
|
config_get remoteip6 "$section" remoteip6
|
||||||
config_get ttl "$section" ttl
|
config_get ttl "$section" ttl
|
||||||
config_get mtu "$section" mtu
|
config_get mtu "$section" mtu
|
||||||
|
config_get delegatedip6 "$section" delegatedip6
|
||||||
|
|
||||||
|
ip -6 ro del $delegatedip6 dev $LAN
|
||||||
ip -6 ro del 2000::/3 via $remoteip6
|
ip -6 ro del 2000::/3 via $remoteip6
|
||||||
ip -6 ro del ::/0 dev $tnlifname
|
ip -6 ro del ::/0 dev $tnlifname
|
||||||
ip addr del $localip6 dev $tnlifname
|
ip addr del $localip6 dev $tnlifname
|
||||||
|
Loading…
x
Reference in New Issue
Block a user