[package] make 6tunnel support a delegated block (#4724)
authorFlorian Fainelli <florian@openwrt.org>
Sun, 14 Mar 2010 16:40:56 +0000 (16:40 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 14 Mar 2010 16:40:56 +0000 (16:40 +0000)
SVN-Revision: 20206

ipv6/6scripts/Makefile
ipv6/6scripts/files/6tunnel.conf
ipv6/6scripts/files/6tunnel.init

index f4e54fe..fb4d0df 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6scripts
 PKG_VERSION:=0.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 include $(INCLUDE_DIR)/package.mk
 
index d334338..f65691d 100644 (file)
@@ -14,3 +14,5 @@ config 6tunnel
        option mtu              '1280'
        # this should provide a ttl for your tunnel interface
        option ttl              '64'
+       # provide your tunnel provider's delegated block (/64 or /48)
+       option delegatedip6     ''
index 5c21e7d..de01473 100644 (file)
@@ -17,13 +17,16 @@ start_service() {
        config_get remoteip6 "$section" remoteip6
        config_get ttl "$section" ttl
        config_get mtu "$section" mtu
+       config_get delegatedip6 "$section" delegatedip6
 
        ip tunnel add $tnlifname mode sit remote $remoteip4 local $localip4 ttl 255
        ifconfig $tnlifname up
        ip link set mtu $mtu dev $tnlifname
        ip tunnel change $tnlifname ttl $ttl
        ip addr add $localip6 dev $tnlifname
+       ip -6 route ::/0 dev $tnlifname
        ip -6 route add 2000::/3 via $remoteip6
+       ip -6 route add $delegatedip6 dev $LAN
 }
 
 stop_service() {
@@ -41,7 +44,9 @@ stop_service() {
        config_get remoteip6 "$section" remoteip6
        config_get ttl "$section" ttl
        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 ::/0 dev $tnlifname
        ip addr del $localip6 dev $tnlifname