LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2010, 09:13 AM   #1
Ltech
LQ Newbie
 
Registered: May 2010
Posts: 3

Rep: Reputation: 0
BLOCK Pings


Hi,

How can I BLOCK pings with IPCHAINS/IPTABLES, whats the line or rule for it?



Thanks.
 
Old 05-07-2010, 09:21 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Google is your friend:
http://www.frozentux.net/iptables-tu...-tutorial.html
 
Old 05-07-2010, 03:41 PM   #3
Ltech
LQ Newbie
 
Registered: May 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 05-07-2010, 04:11 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,622

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by Ltech View Post
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.
 
Old 05-09-2010, 02:01 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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.

Last edited by win32sux; 05-09-2010 at 02:02 AM.
 
Old 05-10-2010, 01:40 PM   #6
Ltech
LQ Newbie
 
Registered: May 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, that is what I was searching for.

I know which types I wanna block so thats ok.


Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
local pings/apache2 sites work from outside. external pings/apt-get not working. BnrStnr Linux - Networking 5 02-25-2010 02:20 PM
no pings mrbeeye *BSD 2 05-24-2004 06:49 PM
Pings gbell72 Linux - Networking 2 09-29-2003 09:09 AM
I can't get pings :( dadinou Linux - Networking 4 09-07-2003 04:03 PM
Lost pings! Stan Cash Linux - Networking 3 11-15-2002 06:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration