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 f4e54fe6b02020fc2d916af1c60a066b9207411a..fb4d0df1e94ee8b8123628d162ad2b64abedb594 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 d334338f84c9ab1ec2aecd71b5ffb6ac444c7c3c..f65691dfd55a536e0a01b5e74a4e7bd235f1f65c 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 5c21e7db9c83aac2b8add8dcf98830b9d401ae93..de01473c10a8190b6b4ebcab7ef33e442bcba7aa 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