From b4ef52194c007ccc90cf2812253368e628bd7615 Mon Sep 17 00:00:00 2001 From: bolvan Date: Mon, 15 Jan 2018 12:23:28 +0300 Subject: [PATCH] do not hardcode br-lan --- init.d/openwrt/firewall.user.athome | 3 ++- init.d/openwrt/firewall.user.domru | 3 ++- init.d/openwrt/firewall.user.tiera | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/init.d/openwrt/firewall.user.athome b/init.d/openwrt/firewall.user.athome index 59b541f..777328f 100644 --- a/init.d/openwrt/firewall.user.athome +++ b/init.d/openwrt/firewall.user.athome @@ -13,6 +13,7 @@ for ext_iface in $wan_iface; do done -sysctl -w net.ipv4.conf.br-lan.route_localnet=1 +network_get_device DEVICE lan +sysctl -w net.ipv4.conf.$DEVICE.route_localnet=1 iptables -t nat -C prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || iptables -t nat -I prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT diff --git a/init.d/openwrt/firewall.user.domru b/init.d/openwrt/firewall.user.domru index 3338fcc..a8fa7b6 100644 --- a/init.d/openwrt/firewall.user.domru +++ b/init.d/openwrt/firewall.user.domru @@ -22,6 +22,7 @@ for ext_iface in $wan_iface; do done -sysctl -w net.ipv4.conf.br-lan.route_localnet=1 +network_get_device DEVICE lan +sysctl -w net.ipv4.conf.$DEVICE.route_localnet=1 iptables -t nat -C prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || iptables -t nat -I prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT diff --git a/init.d/openwrt/firewall.user.tiera b/init.d/openwrt/firewall.user.tiera index 59b541f..777328f 100644 --- a/init.d/openwrt/firewall.user.tiera +++ b/init.d/openwrt/firewall.user.tiera @@ -13,6 +13,7 @@ for ext_iface in $wan_iface; do done -sysctl -w net.ipv4.conf.br-lan.route_localnet=1 +network_get_device DEVICE lan +sysctl -w net.ipv4.conf.$DEVICE.route_localnet=1 iptables -t nat -C prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || iptables -t nat -I prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT