Allow specifying static IPv6 gateways (#2710)
authorFlorian Fainelli <florian@openwrt.org>
Fri, 16 Nov 2007 07:27:59 +0000 (07:27 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Fri, 16 Nov 2007 07:27:59 +0000 (07:27 +0000)
SVN-Revision: 9569

docs/network.tex
package/base-files/files/lib/network/config.sh

index 2c65dd29582a3ceb2cab01367c014e31e4aacc9c..783db464dd309de029445cfdfdf47ad9aee1b444 100644 (file)
@@ -159,4 +159,5 @@ config interface     "lan"
     option ifname    "eth0"
     option proto     "static"
     option ip6addr    "fe80::200:ff:fe00:0/64"
+    option ip6gw     "2001::DEAF:BEE:1"
 \end{Verbatim}
index 6856582974df089dee35ed58aef41cb392797496..b8f350de844ffef2fdc0ebf3364fc4e225773105 100755 (executable)
@@ -150,12 +150,14 @@ setup_interface() {
                        [ -z "$ipaddr" -o -z "$netmask" ] && [ -z "$ip6addr" ] && return 1
                        
                        config_get gateway "$config" gateway
+                       config_get ip6gw "$config" ip6gw
                        config_get dns "$config" dns
                        config_get bcast "$config" broadcast
                        
                        [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
                        [ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
                        [ -z "$gateway" ] || $DEBUG route add default gw "$gateway"
+                       [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw"
                        [ -z "$dns" ] || {
                                for ns in $dns; do
                                        grep "$ns" /tmp/resolv.conf.auto 2>/dev/null >/dev/null || {