System that can ping Google but not Facebook

Garvit Garg
2 min readMar 16, 2021

Hello everyone
In this Blog we are gonna learn to create a system that can ping google but not facebook using Linux OS.

For this we need a Linux System installed.
I am using Virtual Box to create a Linux System.

Follow the following Steps to perform above task :

STEP -1 : Let’s firstly check out system weather it can ping both the servers or not. For that we will use the command ping

ping www.google.com
ping www.facebook.com

Here in above pic we can see we can ping both the websites.

The main reason we can ping various websites is our gateway that allows incoming and outgoing of packages through various servers.
If we delete that rule then we won’t be able to ping any server.

STEP -2 : Delete the routing rule 0.0.0.0
For this we use the command route del -net 0.0.0.0
To check the universal gateways available we use the command route -n

Here we can see we don’t have the destination 0.0.0.0 available

STEP -3 : Now we have a system that cannot ping any website which we can check by using ping command.
Now to create a system that can ping google but not facebook we can add a gateway that allows only the incoming and outgoing of packages only from www.google.com

To do so we can use command — route add -net (Google IP Address) netmask 255.255.255.255 gw (Gateway ID) enp0s3

Here we can see we can now ping google but not facebook.

--

--