Score:0

Bad argument `−−hashlimit−above'

in flag

I am trying to limit packets per second / per IP, however iptables complains about this stating: Bad argument `−−hashlimit−above'.

My rule is as follows:

iptables -I TEST -p tcp -m tcp -m hashlimit −−hashlimit−above 512kb/s −−hashlimit-burst 1mb --hashlimit-mode srcip --hashlimit-name test -j DROP

The example above is literally taken from the iptables man page. Host is using iptables v1.8.7.

I researched over and over and cannot find any reference to such a problem, what could it be?

Please advise, thanks.

Score:1
pt flag

I researched over and over and cannot find any reference to such a problem, what could it be?

Your command line contains some invalid characters. Copy and paste the command line from your question and write it to a file. Now display the file using cat -A, and you should see:

iptables -I TEST -p tcp -m tcp -m hashlimit M-bM-^HM-^RM-bM-^HM-^RhashlimitM-bM-^HM-^Rabove 512kb/s M-bM-^HM-^RM-bM-^HM-^Rhashlimit-burst 1mb --hashlimit-mode srcip --hashlimit-name test -j DROP$

This shows the text you've copied contains some control characters used to effect the formatting of the text in the man page...but they result in an invalid command, because you're not actually typing --hashlimit-above. If you type out the command rather than copy-and-pasting it, so that you have:

iptables -I TEST -p tcp -m tcp -m hashlimit --hashlimit-above 512kb/s --hashlimit-burst 1mb --hashlimit-mode srcip --hashlimit-name test -j DROP

It works as expected.

Mecanik avatar
in flag
Sheesh.... I have no words. Thank you. It seems Remote Desktop Manager is very bugged as it's the only place I copied/pasted back and forth. Again, thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.