Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I did find something but I'm sure how to reverse it to IPTABLES.
Code:
ipchains -A input -s 127.0.0.1 -p icmp -j DENY
And I couldn't figure out how to ICMP type/code to block more specific packets alike:
0 echo-reply ping
5 redirect routing if not running routing daemon
8 echo-request ping
11 time-exceeded traceroute
Of course I was hoping someone who knew the answer would type it out.
I did find something but I'm sure how to reverse it to IPTABLES.
Code:
ipchains -A input -s 127.0.0.1 -p icmp -j DENY
And I couldn't figure out how to ICMP type/code to block more specific packets alike:
0 echo-reply ping
5 redirect routing if not running routing daemon
8 echo-request ping
11 time-exceeded traceroute
Of course I was hoping someone who knew the answer would type it out.
You just need to block ICMP, period. And we were hoping that you'd read the iptables man page, which will tell you how to make that rule, or that you'd follow that link and read it.
If you only want to prevent ping from being used on you, then just block ICMP type 8 packets, like:
Code:
iptables -I INPUT -p ICMP --icmp-type 8 -j DROP
I really think this is a better approach than blocking all ICMP packets (due to potential negative side-effects) but it's up to you, of course. At least this should clarify for you the syntax for specifying ICMP types/codes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.