How to create a Setup so that we can ping google but will not able to ping Facebook from the same system

Kaushal Sharma
2 min readMar 14, 2021

We will be using some basic networking and Routing Table concepts, it will be easy for you to understand too.

Connectivity from google but not facebook

Starting VM and Setup…


In every system there is a routing table,

We can see the routing table is present in our VM which will allow or act as a gateway to carry our request over the Internet. we can see it using the command : route -n

We would be able to see that our VM is able to ping both google and Facebook with the current working setup.

Now we will Delete the gateway , so that the range of IP address that comes in that range will be Unreachable. now when we try to ping either Google or Facebook will be Unreachable.

Here we can confirm and see that Google is Unreachable.

Now by adding a Rule to our Route Table we can able to Ping Google by using

Command: route add netmask gt enp0s3

where enp0s3 refers to our NIC card or you can say LAN card.

gt is the Internet gateway

Awesome! , Now we will be able to ping to Google but not to Facebook.