summaryrefslogtreecommitdiff
path: root/misc/openwrt/etc/hotplug.d
diff options
context:
space:
mode:
Diffstat (limited to 'misc/openwrt/etc/hotplug.d')
-rw-r--r--misc/openwrt/etc/hotplug.d/iface/99-ifup21
1 files changed, 21 insertions, 0 deletions
diff --git a/misc/openwrt/etc/hotplug.d/iface/99-ifup b/misc/openwrt/etc/hotplug.d/iface/99-ifup
new file mode 100644
index 0000000..e3562cd
--- /dev/null
+++ b/misc/openwrt/etc/hotplug.d/iface/99-ifup
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+tables="mts-azov rt-azov mts-il"
+net=
+
+case "$ACTION" in
+ ifup)
+ case "$INTERFACE" in
+ eth2)
+ net=192.168.7
+ ;;
+ eth3)
+ net=192.168.8
+ ;;
+ esac
+ if [ -z "$net" ]; then exit; fi
+ for t in $tables; do
+ ip r add ${net}.0/24 via ${net}.1 table $t
+ done
+ ;;
+esac \ No newline at end of file