Score:0

how to fix this error unknown option "--icmp-type"?

pt flag

I want to block ICMP ping request and I have followed syntax from tutorials, but get the same result:

error image

sudo iptables -A OUTPUT -p icmp --icmp-type echo-request -j DROP
iptables v1.8.7 (nf_tables) : unknown option "--icmp-type"
Try 'iptables -h' or 'iptables --help for more information.

Any help would be appreciated. Thank you.

hr flag
Are you trying to do this on WSL by any chance?
Score:0
in flag

Looking at the manual for iptables there is no --icmp-type option. That said, if you would like to block all ICMP requests, you can do this:

  1. Open Terminal (if it's not already open)
  2. Edit the sysctl.conf file with elevated permissions:
    sudo {editor of choice} /etc/sysctl.conf
    
    Note: Be sure to replace {editor of choice} with your preferred editor.
  3. Add the following line to the end of the file:
    net.ipv4.icmp_echo_ignore_all = 1
    
  4. Save the changes and exit the editor.
  5. Apply the configuration change:
    sysctl -p
    

Now the system will ignore all ICMP requests. This change will persist across reboots, too.

hr flag
The `--icmp-type` option is documented in the `iptables-extensions` man page I think ...
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.