Skip to content

Instantly share code, notes, and snippets.

@fengjijiao
Created February 4, 2022 10:15
Show Gist options
  • Save fengjijiao/e0a884e730c5fbe453b5569c06fec415 to your computer and use it in GitHub Desktop.
Save fengjijiao/e0a884e730c5fbe453b5569c06fec415 to your computer and use it in GitHub Desktop.
nftables nat masquerade configure
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy accept;
}
chain forward {
type filter hook forward priority 0; policy accept;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0; policy accept;
}
chain postrouting {
type nat hook postrouting priority 0; policy accept;
masquerade
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment