Strongswan y nftables (migrando desde iptables)

Strongswan y nftables (migrando desde iptables)

Estoy intentando migrar de iptables a nftables (Debian) y me topé con un muro aquí con las reglas para Strongswan VPN. ¿Alguien puede ayudarme a traducir estas reglas a nftables? El convertidor automático no pudo hacerlo.

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

Respuesta1

Tengo un entorno virtual de prueba local:

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

En el par A y el par B:

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

También en ambos pares tuve que:

sysctl -w net.ipv4.ip_forward=1

Y funcionó para mí.

información relacionada