Home » , » Configure linux server to deny icmp ping request

Configure linux server to deny icmp ping request

Written By 1 on Saturday, February 5, 2011 | 10:28 AM

ICMP protocol is used by ping command to check the connectivity between two computers. By defaults all Linux servers will response on ICMP request. Hacker can misuse this service. They can generate countless ping requests to your Linux server. This is what called DOS denial of services.
In this article I will show that how can you block ICMP ping request
We will use to two system for this practical. Go on first Linux system and set IP address to 192.168.0.254
assign ip on server
Apply new IP by service network restart command and verify it ifconfig
service network restart
Now go other machine and set IP address to 192.168.0.1 (I am using window machine for testing you can use your Linux machine for it also.)
assign ip
verify new ip by ipconfig
ipconfig
Test connectivity with server by ping commands
ping
You will get reply because all Linux servers are by default configured to response on ICMP ping request.
Now go back on Linux server and configure it to deny ping request.
We need to add deny tag in sysctl.conf file open /etc/sysctl.conf file
vi sysctl.conf
Now add net.ipv4.icmp_echo_ignore_all = 1 line in the end of file and save this file
edit in sysclt.conf
Change will take place after restart, reboot system with reboot -f commands
reboot -f
Now try to ping form other system again you will not get replay now
ping
Now other system cannot ping the Linux server but Linux server can ping ohter system as so far our other system have no such service configured. Go on Linux server and pingother system
ifconfig
After doing practical don't forget remove net.ipv4.icmp_echo_ignore_all = 1 line form sysctl.conf on server. Otherwise you will not get replay form server that not good at least in classroom lab.

0 Comment:

Post a Comment