Last active
January 1, 2024 11:22
-
-
Save runapp/497f97e1ca3d40d1b4674d14557aa261 to your computer and use it in GitHub Desktop.
nftables related
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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