Ping Google But Not FaceBook
Creating a Setup so that a system can ping google but not able to ping Facebook
In this article, We will create network topology in such a way that our local VM will be able to ping Google but not to Facebook.
In every operating system, The routing table is responsible for connecting to the internet.
The routing table is consist of the network range and IP of the gateway through which it can connect to the internet.
# route -n → To see routing table in numeric vaule
Here, Destination tells network name and Genmask helps OS to identify network range.
The network name 0.0.0.0 and Genmask 0.0.0.0 means any IP can connect to the system.
Till now, we can connect to both Google and Facebook.
The IP of Google is 172.217.163.78
The IP of FaceBook is 69.171.250.35
We have to update our routing table to achieve network topology as mentioned above in this article.
STEP 1: Remove the routing rule for 0.0.0.0 .
route del -net 0.0.0.0
Now, We are not able to ping anyone.
STEP 2: Allow Google IP to connect to the system.
route add -net google_network_name /genmask gw gw_ip
Now, we are able to ping Google but not Facebook.