]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
firewall: replace mark with --pol ipsec to exclude ipsec traffic from masquerade
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 19 Oct 2021 18:27:49 +0000 (18:27 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 19 Oct 2021 18:27:49 +0000 (18:27 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/firewall

index 5fc63683c773f47ce7a38c45fa113da14236dcf2..776e70d6eea299a865f0a190f72f4269537f2188 100644 (file)
@@ -14,9 +14,6 @@ fi
 
 NAT_MASK="0x0f000000"
 
-IPSEC_MARK="0x00800000"
-IPSEC_MASK="${IPSEC_MARK}"
-
 IPS_REPEAT_MARK="0x80000000"
 IPS_REPEAT_MASK="0x80000000"
 IPS_BYPASS_MARK="0x40000000"
@@ -396,7 +393,7 @@ iptables_red_up() {
                fi
 
                # Outgoing masquerading (don't masqerade IPsec)
-               iptables -t nat -A REDNAT -m mark --mark "${IPSEC_MARK}/${IPSEC_MASK}" -o "${IFACE}" -j RETURN
+               iptables -t nat -A REDNAT -m policy --pol ipsec --dir=out -o "${IFACE}" -j RETURN
 
                if [ "${IFACE}" = "${GREEN_DEV}" ]; then
                        iptables -t nat -A REDNAT -i "${GREEN_DEV}" -o "${IFACE}" -j RETURN