LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   how can i stop ping reply? (https://www.linuxquestions.org/questions/linux-security-4/how-can-i-stop-ping-reply-411350/)

Guru Mind 02-03-2006 03:47 PM

how can i stop ping reply?
 
hi everybody , i have newbie question

how can i stop ping reply videlicet how can i stop reply if anybody ping my IP , or just got my IP but don't got reply?

and sorry for bad english .

pljvaldez 02-03-2006 03:51 PM

I believe you just need to install a firewall and configure it to drop all packets.

ppuru 02-03-2006 04:23 PM

As root

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

This will block all icmp requests.

To make this a permanent settings, add the line below to /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_all = 0

As pljvalez suggested, you can also set a firewall rule to disable icmp reply.

Guru Mind 02-03-2006 06:05 PM

pljvaldez thank you but i wanna stop ping without firewall

ppuru thanks it's worked , but i try to edit sysctl.conf and put what you say but it dosn't worked

anyway thank .

ppuru 02-03-2006 06:14 PM

gurumind, my apologies, set

net.ipv4_icmp_echo_ignore_all = 1

to stop pings. setting it to 0 allows pings.

Guru Mind 02-03-2006 06:33 PM

ok ppuru , but would i must restart service or something like that?

and really thanks ppuru .

ppuru 02-03-2006 06:37 PM

no need, the next time you reboot your system, the icmp_echo_ignore_all will be set.

gilead 02-03-2006 09:41 PM

You don't need to reboot to make the settings take effect. If you've added the line to /etc/sysctl.conf, as root type sysctl -p

Guru Mind 02-04-2006 06:35 AM

after i type sysctl -p

error: "net.ipv4_icmp_echo_ignore_all" is an unknown key

any suggeste?

win32sux 02-04-2006 06:41 AM

Quote:

Originally Posted by Guru Mind
after i type sysctl -p

error: "net.ipv4_icmp_echo_ignore_all" is an unknown key

any suggeste?

try changing the first underscore to a period... like this:
Code:

net.ipv4.icmp_echo_ignore_all

iNeo 02-04-2006 08:59 AM

This is slightly off topic.
I know there is a way in which you can configure some message to be displayed when someone tries to ping our machine. Does anyone know how that is done?

win32sux 02-04-2006 09:07 AM

Quote:

Originally Posted by iNeo
This is slightly off topic.
I know there is a way in which you can configure some message to be displayed when someone tries to ping our machine. Does anyone know how that is done?

well, if you filter the pings with regular iptables instead of sysctl.conf it's just a matter of adding a LOG target rule... so anytime someone pings you it will show-up in /var/log/syslog:
Code:

iptables -I INPUT -p ICMP --icmp-type 8 \
-m state --state NEW -j LOG


dutler 02-04-2006 01:34 PM

are you suing a gui? check out he iptable instface guarddog

ppuru 02-04-2006 05:21 PM

Quote:

Originally Posted by win32sux
try changing the first underscore to a period... like this:
Code:

net.ipv4.icmp_echo_ignore_all

Thanks win32sux, sorry for the typo Gurumind.

net.ipv4.icmp_echo_ignore_all is the correct key.

sysctl -a gives a list of all settable parameters. Play around at your own risk.

Guru Mind 02-04-2006 06:17 PM

Thanks win32sux and ppuru for help

it's working now


All times are GMT -5. The time now is 11:56 AM.