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

そしてそれは私にとっては効果がありました。

関連情報