Google Is Pinging But Not Able To Ping Facebook From The Same System 😲 How ??🤔
So here I come with my new blog, where I’m going to show you the magic behind this 🙃🙃why and how?
“SO LET’S CREATE A SETUP WHICH CAN PING GOOGLE BUT NOT ABLE TO PING FACEBOOK FROM SAME SYSTEM”
Before doing the further steps let me share you about some basic knowledge of Networking…….
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. Each packet contains information about its origin and destination.
When a packet is received, a network device examines the packet and matches it to the routing table entry providing the best match for its destination. To determine out which interface the packet will be sent, routers use routing tables. A routing table lists all networks for which routes are known.
- A netmask is a 32-bit binary mask used to divide an IP address into subnets and specify the network’s available hosts.
- They’re used to define a range of IP addresses.
- A gateway is a hardware device that acts as a “gate” between two networks that enables traffic to flow in and out of the network.
- Gateway is located at the boundary of a network and manages all data that inflows or outflows from that network.
- It also stores information about the routing paths of the communicating networks.
OKAY now let’s jump to the practical
First we have to check if the Google and Facebook both are pinging or not ?
Command : ping google.com
Command : ping facebook.com
So this is possible because of the default gateway IP Address which is 0.0.0.0 is added to the routing table. By this IP we can go to any destination or outer world wherever we want to reach.
Now let’s see which rules are added to our routing table
Command : route -n
So here we can see the default IP address is added to our routing table, that’s why we are able to ping our destination.
Now we delete our default gateway IP which allows us to connect to the outer world
Command : route del -net 0.0.0.0
Now again we have to check the connection whether google and facebook are pinging or not ?
We can check the google nd others of IP address by nslookup command
In the above picture we can see that both are not pinging because we deleted/removed the default gateway IP from our routing table which help us to connect with the outside world.
Now we add some rules in the routing table for only which can ping Google
Command : route add -net 126.96.36.199 netmask 255.255.0.0 gw 192.168.43.1
So here I pick the Google IP, netmask and gateway IP and added to my routing table.
Now if we try to ping then we can see the result is —
We are able to ping Google✔️ but not able to ping Facebook🚫.
In this practical I have shown that how networking works and it’s rules and how to add our own rules and can do anything whatever we want.
Thank You For Reading My Article Hope You Will Like It…..