LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-25-2004, 08:43 PM   #1
romel
Member
 
Registered: Sep 2003
Location: Bangladesh
Distribution: Debian
Posts: 102

Rep: Reputation: 15
Question disable ping


How can I disable ping....I am using redhat linux 9...
 
Old 12-25-2004, 08:47 PM   #2
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
Why do you want to do this? Or do you just not need it?
 
Old 12-25-2004, 09:01 PM   #3
zxzx123
LQ Newbie
 
Registered: Dec 2004
Location: London
Distribution: Fedora Core 3
Posts: 5

Rep: Reputation: 0
At a guess you could just set the permissions so that it cannot be run by anbody apart from file owner (root), log in under root, and navigate to the directory, /bin and adjust the ping file's properties.

I would be interested to know if that has the desired effect, gl!
 
Old 12-28-2004, 06:06 AM   #4
kaito
LQ Newbie
 
Registered: Nov 2004
Location: japan
Distribution: plamo, fedora
Posts: 27

Rep: Reputation: 15
If you want not to reply ping(echo-request), change /proc/sys/net/ipv4/icmp_echo_ignore_all; do the following command.

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

If you want to disallow ping, set proper permission to ping as zxzx123 said, or filter packets by using iptables; a example rule is following

iptables -a OUTPUT -j DROP -p icmp --icmp-type 8


im glad my advice to your help
 
Old 12-28-2004, 08:15 AM   #5
whipermr5
Member
 
Registered: Dec 2004
Location: Singapore
Distribution: Fedora Core 5 Linux
Posts: 202

Rep: Reputation: 30
You can
Code:
mv /bin/ping /bin/ping.old
If you ever want ping again, you can type ping.old, or reverse the operation above.
 
Old 12-30-2004, 11:50 PM   #6
romel
Member
 
Registered: Sep 2003
Location: Bangladesh
Distribution: Debian
Posts: 102

Original Poster
Rep: Reputation: 15
I have tried

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

but it is not working......I have restarted my pc....but not working...

thanks....

Quote:
Originally posted by kaito
If you want not to reply ping(echo-request), change /proc/sys/net/ipv4/icmp_echo_ignore_all; do the following command.

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

If you want to disallow ping, set proper permission to ping as zxzx123 said, or filter packets by using iptables; a example rule is following

iptables -a OUTPUT -j DROP -p icmp --icmp-type 8


im glad my advice to your help
 
Old 12-31-2004, 11:41 AM   #7
kaito
LQ Newbie
 
Registered: Nov 2004
Location: japan
Distribution: plamo, fedora
Posts: 27

Rep: Reputation: 15
Quote:
Originally posted by romel
I have tried

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

but it is not working......I have restarted my pc....but not working...

thanks....
Could u tell me what is not working, romel? Replying to ping from another host, or Can ping command on the setting host? If the solution i said is set, you can do ping command on the host. This setting is only not to reply to ping from another host.

Tell us your situation detail
 
Old 01-01-2005, 11:22 AM   #8
nikonos
LQ Newbie
 
Registered: Dec 2004
Posts: 3

Rep: Reputation: 0
The best is use iptables rule. You can allow ping from some IP ...

example:

iptables -a INPUT -p icmp -s 212.18.49.194 -j ACCEPT
iptables -a INPUT -p icmp -j DROP

iptables -a OUTPUT -p icmp -j DROP

Regards,

Miha
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
How to disable ping? sdat1333 Fedora 4 12-11-2004 10:23 AM
how to disable ping Longinus Linux - Networking 1 08-24-2004 12:00 AM
how to disable ping ? juanb Linux - Security 7 07-23-2003 12:07 PM
Disable ping on RedHat 9 DNS box lindab_tsp Linux - Security 4 07-21-2003 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 PM.

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