Browse Source

Add nftables examples

Provide nftables examples for nat6 masqerading.
Avinash H. Duduskar 3 years ago
parent
commit
ac98219789
1 changed files with 6 additions and 0 deletions
  1. 6 0
      doc/nat-gateway.md

+ 6 - 0
doc/nat-gateway.md

@@ -74,6 +74,12 @@ Now enter the ip6tables rules:
     ip6tables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
     ip6tables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
     ip6tables -A FORWARD -i eth1 -o eth0 -j ACCEPT
+    
+Or if you use nftables:
+
+    nft add rule ip6 nat POSTROUTING oifname "tun0" counter masquerade
+    nft add rule ip6 filter FORWARD iifname "tun0" oifname "eth0" ct state related,established accept
+    nft add rule ip6 filter FORWARD iifname "eth1" oifname "eth0" accept
 
 Save the rules: