Skip to content

Commit

Permalink
Fix for CentOS 9
Browse files Browse the repository at this point in the history
- Fixed an issue with nftables on CentOS 9/8, where users may
  encounter the error "unsupported xtables compat expression"
  during VPN setup.
  • Loading branch information
hwdsl2 committed May 2, 2024
1 parent 30a46a0 commit bf965cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vpnsetup_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf965cf

Please sign in to comment.