I've tested my machine on Shields up application on the grc dot com site where was indicated that my machine was not fully stealth, because it was replying to ping packets sent from this site. So I've tried several methods, but non resulted with success.
First I've tried with editing /etc/sysctl.conf by a net.ipv4.icmp_echo_ignore_all=1
Next I've edited /etc/ufw/before.rules file with adding this line: -A ufw-before-input -p icmp --icmp-type echo-request -j DROP
I've also tried with these commands to iptables: iptables -A INPUT --proto icmp -j DROP iptables -I INPUT -p icmp --icmp-type echo-request -j DROP
And finally I've tried with editing of crontab -e by adding the following line: @reboot echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
I know it is possible to do on a router. But I wanted to try to disable ping responses on my machine independently from router. I want to know how it could be done, so that when I connect with my Ubuntu laptop on some public wi-fi, I could be sure that nobody could ping my machine.
This is interesting. When I use my regular connection, my PC passes the 'true stealth analysis' on the rec dot com site, in both cases (with just my wifi access point and with access point and router). But when I try with VPN then the 'true stealth analysis' fails.
... and that would only be the web-facing VPN's router, not the VPN's router publishing anything about your computer or contents of the encrypted data stream.