Skip to content

Commit a42cca9

Browse files
committed
use py_captive_portal_enabled and restore captive_portal_enabled
1 parent 1db1a68 commit a42cca9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

roles/network/templates/gateway/iiab-gen-iptables

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ if [ "$gw_block_https" == "True" ]; then
105105
fi
106106

107107
# Allow outgoing connections from the LAN side.
108-
if ! [ "$captive_portal_enabled" == "True" ];then
108+
if ! [ "$py_captive_portal_enabled" == "True" ];then
109109
$IPTABLES -A FORWARD -i $lan -o $wan -j ACCEPT
110110
fi
111111
# Don't forward from the outside to the inside.
@@ -117,13 +117,13 @@ if [ "$block_DNS" == "True" ];then
117117
$IPTABLES -t nat -A PREROUTING -i $lan -p udp --dport 53 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:53
118118
fi
119119

120-
#if [ "$captive_portal_enabled" == "True" ];then
121-
# $IPTABLES -t mangle -N internet
122-
# $IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet
123-
# $IPTABLES -t mangle -A internet -j MARK --set-mark 99
124-
# $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }}:
125-
126120
if [ "$captive_portal_enabled" == "True" ];then
121+
$IPTABLES -t mangle -N internet
122+
$IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet
123+
$IPTABLES -t mangle -A internet -j MARK --set-mark 99
124+
$IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }}:
125+
126+
elif [ "py_$captive_portal_enabled" == "True" ];then
127127
$IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:9090
128128

129129
elif [ "$HTTPCACHE_ON" == "True" ]; then

0 commit comments

Comments
 (0)