Fix for CentOS 9

- Fixed an issue with nftables on CentOS 9/8, where users may
  encounter the error "unsupported xtables compat expression"
  during VPN setup.
This commit is contained in:
hwdsl2 2024-05-01 20:35:02 -05:00
parent 30a46a0e15
commit bf965cfd18
1 changed files with 5 additions and 1 deletions

View File

@ -624,7 +624,11 @@ update_iptables() {
if [ "$use_nft" != 1 ]; then
iptables -A FORWARD -j DROP
fi
$ipp -s "$XAUTH_NET" -o "$NET_IFACE" -m policy --dir out --pol none -j MASQUERADE
if [ "$use_nft" = 1 ]; then
$ipp -s "$XAUTH_NET" -o "$NET_IFACE" ! -d "$XAUTH_NET" -j MASQUERADE
else
$ipp -s "$XAUTH_NET" -o "$NET_IFACE" -m policy --dir out --pol none -j MASQUERADE
fi
$ipp -s "$L2TP_NET" -o "$NET_IFACE" -j MASQUERADE
echo "# Modified by hwdsl2 VPN script" > "$IPT_FILE"
if [ "$use_nft" = 1 ]; then