0

I have a problem to set postrouting chain in nat table in nftables. I have ubuntu 22.04 lts.

I added table nat:

nft add table ip nat

I tried to add postrouting to this table :

nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; policy accept\; }

but I got an error:

Error: No such file or directory; did you mean chain ‘postrouting’ in table ip ‘nat’?
add chain ip nat postrouting { type nat hook postrouting priority 100 ; policy accept; }
                                    ^^^

I try to add an empty chain and then add rule:

nft add chain ip nat postrouting
add rule ip nat postrouting oifname wlP1p1s0 masquerade

but I got an error on masquerade: Error: Could not process rule: No such file or directory.

Any help would be appreciated.

0 Answers0