The Configuration a system so it does not respond to any ping and it survive a reboot.

Information about ping is stored in a file /proc/sys/net/ipv4/icmp_echo_ignore_all.If its value is 0 then its work normally in the ping.If the value is 1 then its does not respond any ping.

#echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
#ping www.google.com(ping is possible)
#ping localhost (not possible)
now restart the machine.
#init 6

#ping localhost(ping is possible)

what happen???????

/proc is used to get or set kernel configuration.virtual file system not stored on hard disk,it is stored on ram.Modification apply immediately.

To set any parameter change must be done in a file name /etc/sysctl.conf.
#vi /etc/sysctl.conf

add the following line and save the file:-
net.ipv4.icmp_echo_ignore_all=1
save the file using :wq[Enter]

#sysctl -p[Reload the settings from sysctl.conf file]
#cat /proc/sys/net/ipv4/icmp_echo_ignore_all
1
Result is 1 so it does not respond any ping.
#ping localhost[not possible]
#init 6
#ping localhost [not possible]
Change in a file /etc/sysctl.conf must survive a reboot.

Comments

  1. Does it disable the ICMP service? Or just the ICMP_ECHO_REQUEST response?

    If that is the case nobody can tracert to localhost!

    ReplyDelete
  2. it only disable ping(ICMP echo request) feature............
    localhost does not respond any ping.

    ReplyDelete

Post a Comment

Popular posts from this blog

Few tips for Linux User related to MAN page

SEND Mail Using JAVA Mail API