Converting from iptables to nftables syntax
by lonesoac0 from LinuxQuestions.org on (#4WV3C)
Hello all,
I am trying to convert the commands of:
Code:iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPTto nftables command syntax.
Code:nft add rule ip nat POSTROUTING oifname "eth0" counter masquerade
nft add rule ip filter FORWARD iifname "eth0" oifname "wlan0" ct state related,established counter accept
nft add rule ip filter FORWARD iifname "wlan0" oifname "eth0" counter acceptI keep getting the error codes that look like:
Error: Could not process rule: No such file or directory
add rule ip filter FORWARD iifname wlan0 oifname eth0 counter accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What am I missing?


I am trying to convert the commands of:
Code:iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPTto nftables command syntax.
Code:nft add rule ip nat POSTROUTING oifname "eth0" counter masquerade
nft add rule ip filter FORWARD iifname "eth0" oifname "wlan0" ct state related,established counter accept
nft add rule ip filter FORWARD iifname "wlan0" oifname "eth0" counter acceptI keep getting the error codes that look like:
Error: Could not process rule: No such file or directory
add rule ip filter FORWARD iifname wlan0 oifname eth0 counter accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What am I missing?