"select this option."))
strict.rmempty = false
+local fallback = c:option(Flag, "fallback", translate("Fallback to mesh"),
+ translate("If your own gateway is not available then fallback to the mesh default gateway."))
+strict.rmempty = false
+
local zones = c:option(MultiValue, "zones", translate("Firewall zones"), translate("All traffic from interfaces belonging to these zones will be sent via "..
"a gateway in the mesh network."))
uci:foreach("firewall", "zone", function(section)
config 'settings' 'pr'
option 'enable' '0'
option 'strict' '1'
+ option 'fallback' '1'
option 'zones' ''
[ "$INTERFACE" != "wan" ] && exit 0
+[ -f /proc/net/ipv6_route ] && has_ipv6=1
case $ACTION in
ifup)
- pr=`uci get freifunk-policyrouting.pr.enable`
+ pr="`uci get freifunk-policyrouting.pr.enable`"
+ fallback="`uci get freifunk-policyrouting.pr.fallback`"
# check if ipv6 is enabled:
- [ -f /proc/net/ipv6_route ] && has_ipv6=1
if [ $pr = "1" ]; then
logger -t policyrouting "Starting policy routing on $INTERFACE"
ip route add $NETWORK/$NETMASK dev $device table default
ip route add default via $gw dev $device table default
- #if [ "$has_ipv6" = 1 ]; then
- # local ip6gw=$(ip -6 r |grep default |cut -d " " -f 3)
- # test -n "`ip -6 r s t default`" && ip -6 r d default t default
- # test -n "`ip -6 r s |grep default`" && ip -6 route del default
- # ip -6 r a $ip6gw via $ip6gw dev $dev table default
- # ip -6 route add default via $ip6gw dev $device table default
- #fi
-
+ if [ "$has_ipv6" = 1 ]; then
+ local ip6gw=$(ip -6 r |grep default |cut -d " " -f 3)
+ test -n "`ip -6 r s t default`" && ip -6 r d default t default
+ if [ -n "`ip -6 r s |grep default`" ]; then
+ ip -6 route del default
+ ip -6 r a $ip6gw via $ip6gw dev $dev table default
+ ip -6 route add default via $ip6gw dev $device table default
+ fi
+ fi
ip rule del lookup main
ip rule add fwmark 1 lookup olsr-default
ip rule add lookup main
ip rule add lookup olsr
+ # Fallback via mesh if no ipv4 gateway is found in default table
+ [ "$fallback" = 1 ] && ip rule add lookup olsr-default prio 32800
+
if [ "$has_ipv6" = 1 ]; then
ip -6 rule del lookup main
- ip -6 rule add fwmark 1 lookup olsr-default prio 16385
- ip -6 rule add lookup main prio 16383
ip -6 rule add lookup olsr prio 16380
+ ip -6 rule add lookup main prio 16390
+ ip -6 rule add fwmark 1 lookup olsr-default prio 16400
+ ip -6 rule add lookup default prio 16410
+ [ "$fallback" = 1 ] && ip -6 rule add lookup olsr-default prio 16420
fi
else
# Remove custom routing tables from olsrd
;;
ifdown)
- logger -t policyrouting "Deleting policy rules for $INTERFACE"
+ logger -t policyrouting "Deleting ipv4 policy rules for $INTERFACE"
ip rule del fwmark 1 lookup olsr-default > /dev/null 2>&1
+ ip rule del lookup olsr-default > /dev/null 2>&1
ip rule del lookup olsr > /dev/null 2>&1
if [ "$has_ipv6" = 1 ]; then
+ logger -t policyrouting "Deleting ipv4 policy rules for $INTERFACE"
ip -6 rule del fwmark 1 lookup olsr-default > /dev/null 2>&1
- ip -6 rule del lookup olsr > /dev/null 2>&1
+ ip -6 rule del lookup olsr-default > /dev/null 2>&1
+ ip -6 rule del lookup olsr > /dev/null 2>&1
+ ip -6 rule del lookup default > /dev/null 2>&1
fi
;;
esac
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr "Zóny firewallu"
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"PO-Revision-Date: \n"
"Last-Translator: Manuel Munz <freifunk@somakoma.de>\n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: \n"
msgid ""
"All traffic from interfaces belonging to these zones will be sent via a "
msgid "Enable Policy Routing"
msgstr "Policy Routing aktivieren"
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr "Firewallzonen"
"Routers geleitet. Wenn das nicht gewünscht ist und dieser Traffic dann "
"stattdessen geblockt werden soll, dann aktiviere diese Option."
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr "Policy Routing"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"PO-Revision-Date: 2011-10-18 22:26+0200\n"
"Last-Translator: Luiz Angelo <luizluca@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Pootle 2.0.4\n"
msgid "Enable Policy Routing"
msgstr "Habilitar a Política de Roteamento"
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr "Zonas do firewall"
"como solução de contorno. Se você não quer isto e, ao contrário, deseja "
"bloquear este tráfego, então você deve selecionar esta opção."
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr "Política de Roteamento"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"PO-Revision-Date: 2011-07-25 12:52+0200\n"
"Last-Translator: Kamal <kamal.aliev@epscom.ru>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: ru\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Pootle 2.0.4\n"
msgid ""
msgid "Enable Policy Routing"
msgstr "Разрешить политику маршрутизации"
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr "Зоны межсетевого экрана"
"ячеистой сети. Если Вас это не устраивает, то выберите эту опцию и данный "
"траффик будет заблокирован."
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr "Политика маршрутизации"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
msgid ""
"All traffic from interfaces belonging to these zones will be sent via a "
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""
msgid "Enable Policy Routing"
msgstr ""
+msgid "Fallback to mesh"
+msgstr ""
+
msgid "Firewall zones"
msgstr ""
"traffic then you should select this option."
msgstr ""
+msgid ""
+"If your own gateway is not available then fallback to the mesh default "
+"gateway."
+msgstr ""
+
msgid "Policy Routing"
msgstr ""