Setup to ping google but not able to ping Facebook..!!

Sourav Dinda
3 min readJun 3, 2021

TASK DESCRIPTION:

Here we gonna Create a Setup by which we can Ping Google But Not able to ping Facebook from same system.

Let’s start with the setup..!

First lets check whether we can ping Google and Facebook.

As we know that, whenever we PING any of the IP from our System, It will start to create a Network packets but ROUTING TABLE is the one who decides whether we have to send this Packets or not by seeing their ROUTER RULES. If the IP is comes under the IP ranges that’s present in Routing Table of our OS, then it will start to send the packets else it wouldn’t possible to send the packets to that IP.

ROUTING TABLE:- A routing table is a set of rules, often viewed in table format, that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled devices, including routers and switches, use routing tables.

Let’s go deep dive into the practical part-

STEP-1:- For doing this practical I have used the RED HAT 8 Linux OS. Command to see the Routing table:-

route -n

Here first we have to Delete one Rule from our Routing Table which has Destination- 0.0.0.0 & Netmask- 0.0.0.0 because this Rule allows our OS to ping any of the Public IP of the world using SNAT of the Router. Command:-

route del -net 0.0.0.0

STEP-4:- Now after deleting that Rule, if you try to ping any of the Public IP either google, facebook, etc. It will not ping. But before this let’s first fetch out what’s the IP’s of Google & Facebook using nslookup. Command:-

nslookup facebook.com

nslookup google.com

Now if you try to ping this IP’s, you will see it’s not ping.

Now for completing this practical we just only have to add 1 rule in our OS Routing table, by which it only ping google but not facebook. Command:-

route add -net 216.58.196.0 gw 192.168.43.1 netmask 255.255.255.0 enp0s3

Now if you try to ping google(216.58.196.78) you will see it is pinging but not Facebook(31.13.79.35):-

So here we finally completed the setup, hope you found my blog helpful.

Thank-you! Keep Learning, Keep Sharing Knowledge..!

--

--

Sourav Dinda
Sourav Dinda

No responses yet