How to disable Ping response in Ubuntu

Ubuntu disable ping in ubuntu 78 times1 answer1 follower
0
Mel Khamlichi 103 Rep. Avishek Kumar edited question

Am running  Ubunto 16.10 . how to disable people to ping me on local network.

♥ Spread the love ♥
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
0
Avishek Kumar 449 Rep. Avishek Kumar edited answer

If you want to temporarily disable ping so that others can not ping you, you may run, as root
 
# echo “1” >  /proc/sys/net/ipv4/icmp_echo_ignore_all
 
This will disable ping till you restart your Linux box. To enable ping again without restart all you need to do is to run the below one liner command, as root
 
# echo “0” >  /proc/sys/net/ipv4/icmp_echo_ignore_all
 
To disable, ping to your box permanently, you need to run the below commands
 
1. Open /etc/sysctl.conf and add the below line to its end.
net.ipv4.icmp_echo_ignore_all = 1
 
2. Enforce setting to be taken into effect immediately, by running the below command in a terminal, as root
# sysctl -p
 
Alternatively, you may run the below one liner script to perform both the tasks in one go.
 
# echo net.ipv4.icmp_echo_ignore_all = 1 >> /etc/sysctl.conf && sysctl -p

♥ Spread the love ♥
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
×

Login