Strongswan 和 nftables(從 iptables 遷移)

Strongswan 和 nftables(從 iptables 遷移)

我正在嘗試從 iptables 遷移到 nftables (Debian),但在 Strongswan VPN 規則方面遇到了困難。有人能幫我把這個規則翻譯成 nftables 嗎?自動轉換器無法做到這些。

# -t filter -A FORWARD -s 10.10.10.2/24 -m policy --dir in --pol ipsec --proto esp -j ACCEPT -m comment --comment VPN forwarding
# -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT
# -t mangle -A FORWARD -s 10.10.10.0/24 -o eth0 -p tcp -m policy --dir in --pol ipsec -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360

答案1

我有一個本地測試虛擬環境:

Client A <--> Strongswan Peer A <--> Strongswan Peer B <--> Client b

在對等點 A 和對等點 B 中:

nft add table nat
nft add chain nat postrouting { type nat hook postrouting priority 0 \; }
nft add rule nat postrouting masquerade

在這兩個同行中,我也必須:

sysctl -w net.ipv4.ip_forward=1

這對我有用。

相關內容