Skip to content

Instantly share code, notes, and snippets.

@runapp
Last active January 1, 2024 11:22
Show Gist options
  • Save runapp/497f97e1ca3d40d1b4674d14557aa261 to your computer and use it in GitHub Desktop.
Save runapp/497f97e1ca3d40d1b4674d14557aa261 to your computer and use it in GitHub Desktop.
nftables related
# rate limit, max 20KB/s from 192.168.1.1
nft -f - <<EOF
table ip test {
chain inbound {
type filter hook input priority filter; policy accept;
ip saddr 192.168.1.1 limit rate over 20 kbytes/second drop
}
}
EOF
# commands:
nft add table test
nft add nft add chain test inbound { type filter hook input priority 0 \; }
nft add rule test inbound ip saddr 192.168.1.1 limit rate over 20 kbytes/second drop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment