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

그리고 그것은 나에게 효과가 있었습니다.

관련 정보