Strongswan und nftables (Migration von iptables)

Strongswan und nftables (Migration von iptables)

Ich versuche, von iptables auf nftables (Debian) zu migrieren und stoße hier mit den Regeln für Strongswan VPN auf ein Hindernis. Kann mir jemand helfen, diese Regeln in nftables zu übersetzen? Der automatische Konverter konnte das nicht.

# -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

Antwort1

Ich habe eine lokale virtuelle Testumgebung:

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

In Peer A und Peer B:

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

Außerdem musste ich in beiden Peers:

sysctl -w net.ipv4.ip_forward=1

Und bei mir hat es funktioniert.

verwandte Informationen