summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-policyrouting/files/etc/hotplug.d
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2013-06-02 23:53:23 +0000
committerManuel Munz <freifunk@somakoma.de>2013-06-02 23:53:23 +0000
commit7c9e0484e9842bb9b0e7a63a0a0857cc3d59bb21 (patch)
treefd95e451483551ae5589df3988d4f64225bdc7a8 /contrib/package/freifunk-policyrouting/files/etc/hotplug.d
parenta1bd60ef6ee775b8bb12fb1db61ae792b41e9d86 (diff)
contrib/freifunk-policyrouting: Make it work with firewall3 and make use of the new ip rule support in /etc/config/network
Diffstat (limited to 'contrib/package/freifunk-policyrouting/files/etc/hotplug.d')
-rw-r--r--contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting b/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
index 5c4eb38e98..327e8793be 100644
--- a/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
+++ b/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
@@ -9,9 +9,9 @@ proto="4"
config_load freifunk-policyrouting
config_get enable pr enable
config_get fallback pr fallback
+config_get strict pr strict
config_get zones pr zones
-
if [ "$ACTION" = "ifup" ] && [ "$enable" = "1" ]; then
network_get_subnet net $INTERFACE
network_get_subnet6 net6 $INTERFACE
@@ -54,6 +54,9 @@ if [ "$ACTION" = "ifup" ] && [ "$enable" = "1" ]; then
for p in $proto; do
if [ ! "$(ip -$p ru s | grep "from all iif $dev lookup olsr-default")" ]; then
ip -$p rule add dev "$dev" lookup olsr-default prio 20000
+ if [ "$strict" != 0 ]; then
+ ip -$p rule add dev "$dev" unreachable prio 20001
+ fi
if [ "$?" = 0 ]; then
logger -s -t policyrouting "Use mesh gateway for interface $dev (IPv$p)"
if [ -z "$(uci -P /var/state get freifunk-policyrouting.${INTERFACE})" ]; then
@@ -87,6 +90,7 @@ if [ "$ACTION" = "ifdown" ]; then
for p in $proto; do
if [ "$(ip -$p ru s | grep "from all iif $dev lookup olsr-default")" ]; then
ip -$p rule del dev "$dev" lookup olsr-default prio 20000
+ ip -$p rule del dev "$dev" unreachable prio 20001
if [ "$?" = 0 ]; then
logger -s -t policyrouting "Remove rule: dev "$dev" lookup olsr-default prio 20000 (IPv$p)"
else