From b4505d7239583e5c8f57aa6a30de36a2c18f4ccd Mon Sep 17 00:00:00 2001 From: bolvan Date: Tue, 14 May 2019 09:53:39 +0300 Subject: [PATCH] init sysv: enable route_localnet only for IFACE_LAN --- init.d/sysv/zapret | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/sysv/zapret b/init.d/sysv/zapret index 94cab07..b2302df 100755 --- a/init.d/sysv/zapret +++ b/init.d/sysv/zapret @@ -242,7 +242,7 @@ prepare_tpws() id -u $TPWS_USER >/dev/null 2>/dev/null || useradd --no-create-home --system --shell /bin/false $TPWS_USER # otherwise linux kernel will treat 127.0.0.1 as "martian" ip and refuse routing to it # NOTE : kernels <3.6 do not have this feature. consider upgrading or change DNAT to REDIRECT and do not bind to 127.0.0.1 - for iface in /proc/sys/net/ipv4/conf/*; do sysctl -qw net.ipv4.conf.$(basename $iface).route_localnet=1; done + [ -n "$IFACE_LAN" ] && sysctl -qw net.ipv4.conf.$IFACE_LAN.route_localnet=1 } run_tpws()