A set up that could ping google but not facebook from same system
So we’ve gathered here to find how to ping google but not facebook which can also mean to be able to ping only google and block all other IP’s… Let’s get started…
this displays your routing table with destination 0.0.0.0 which means you are free to ping any website/any IP. So first step is to delete this entry:
route del -net 0.0.0.0
Now the next step is to add google IP to our routing table to be able to ping only google and not facebook(/others). So make sure you get your google ip either by using nslookup command or by pinging to google before configuring our route table and then your gateway ip which will be available in your routing table before deleting 0.0.0.0 (in my case which is 192.168.0.1).
route add -net 220.127.116.11/24 gw 192.168.0.1 enp0s3
the above command adds certain range of IP’s along with google IP. We can cross check by using route -n. (enp0s3 — network card name)
The Last step is to just to review and check.
Yes! pinging fine.. Let’s do the same with facebook
Finally Facebook is not pinging but google!!!