mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-17 06:23:00 +02:00
firewall: fix green only mode.
disable masquerade and green IP/NET check if internet is connected via green.
This commit is contained in:
@@ -110,8 +110,15 @@ case "${POLICY}" in
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
# Access from GREEN is granted to everywhere
|
||||
iptables -A POLICYFWD -i "${GREEN_DEV}" -s "${GREEN_NETADDRESS}/${GREEN_NETMASK}" -j ACCEPT
|
||||
if [ "${IFACE}" = "${GREEN_DEV}" ]; then
|
||||
# internet via green
|
||||
# don't check source IP/NET if IFACE is GREEN
|
||||
iptables -A POLICYFWD -i "${GREEN_DEV}" -j ACCEPT
|
||||
else
|
||||
iptables -A POLICYFWD -i "${GREEN_DEV}" -s "${GREEN_NETADDRESS}/${GREEN_NETMASK}" -j ACCEPT
|
||||
fi
|
||||
|
||||
# Grant access for IPsec VPN connections
|
||||
iptables -A POLICYFWD -m policy --pol ipsec --dir in -j ACCEPT
|
||||
|
||||
@@ -311,7 +311,10 @@ iptables_red() {
|
||||
|
||||
# Outgoing masquerading (don't masqerade IPSEC (mark 50))
|
||||
iptables -t nat -A REDNAT -m mark --mark 50 -o $IFACE -j RETURN
|
||||
iptables -t nat -A REDNAT -o $IFACE -j MASQUERADE
|
||||
|
||||
if [ "$IFACE" != "$GREEN_DEV" ]; then
|
||||
iptables -t nat -A REDNAT -o $IFACE -j MASQUERADE
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user