[package] add ttl, mtu and set defautl route via gateway instead of interface, making...
authorFlorian Fainelli <florian@openwrt.org>
Tue, 10 Mar 2009 09:24:17 +0000 (09:24 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 10 Mar 2009 09:24:17 +0000 (09:24 +0000)
SVN-Revision: 14833

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

index 2b398d08085b5a756a24f7e2046d4ca3d34f83ee..6a7f2492bd0c70c50980ddb164ce021f34eb1a84 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6scripts
 PKG_VERSION:=0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 include $(INCLUDE_DIR)/package.mk
 
index efd8f817c758ed3a2fbc56f81dd2f0c1301ec474..7bf510fe5cb700408f64bbba85fdddcd61f5f585 100644 (file)
@@ -1,6 +1,19 @@
 config 6tunnel
-        option tnlifname     'sixbone'
-        option remoteip4       ''
+    option tnlifname    'sixbone'
+    # provide your tunnel providers' ipv4 address
+    option remoteip4   ''
+    # provide your public ipv4 address
        option localip4         ''
+       # provide your local ipv6 address including prefix, 
+       # eg. 2001:610::2/64
        option localip6         ''
+       # provide your tunnel providers' ipv6 address excluding 
+       # prefix, eg. 2001:610::1
+       option remoteip6                ''
+       # this should be a network prefix and gateway address 
+       # for your local lan eg 2001:610:1000:1/64
        option prefix           '/64'
+    # this should provide an mtu for your tunnel interface
+    option mtu          '1280'
+    # this should provide a ttl for your tunnel interface
+    option ttl          '64'
index 84ba325632670a206805a2c7af23e534c97a89aa..acd79bff2ca63010d6e2747f72933d23a9344e04 100644 (file)
@@ -14,13 +14,17 @@ start_service() {
        config_get remoteip4 "$section" remoteip4
        config_get localip4 "$section" localip4
        config_get localip6 "$section" localip6
+       config_get remoteip6 "$section" remoteip6
        config_get prefix "$section" prefix
+       config_get ttl "$section" ttl
+       config_get mtu "$section" mtu
 
        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 route add ::/0 dev $tnlifname
-       ip route add 2000::/3 dev $tnlifname
+       ip -6 route add 2000::/3 via $remoteip6
        ip -6 addr add $prefix dev $LAN
 }
 
@@ -36,10 +40,13 @@ stop_service() {
        config_get remoteip4 "$section" remoteip4
        config_get localip4 "$section" localip4
        config_get localip6 "$section" localip6
+       config_get remoteip6 "$section" remoteip6
        config_get prefix "$section" prefix
+       config_get ttl "$section" ttl
+       config_get mtu "$section" mtu
 
        ip -6 addr del $prefix dev $LAN
-       ip -6 ro del 2000::/3 dev $tnlifname
+       ip -6 ro del 2000::/3 via $remoteip6
        ip -6 ro del ::/0 dev $tnlifname
        ip addr del $localip6 dev $tnlifname
        ifconfig $tnlifname down