⚜Setup that can ping Google but not Facebook

🔰Task Description📄

Create a Setup so that you can ping google but not able to ping Facebook from same system

Hello everyone,🙋‍♂️🙋‍♂️

This Blog contains a demonstration of a setup that can ping Google but not Facebook.

We can achieve this with the help of a Routing Table, so let’s first discuss what Routing Table is.

💻Routing Table

A routing table is a set of rules, often viewed in a 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.

♦️ Now we have discussed the Routing Table so let’s start with the demonstration…

👁‍🗨First let’s check the routing table in our system

To check the routing table, use command route -n

Here you can see the routing table with the default rule that is destination 0.0.0.0, this means we can connect to anyone.

Netmask is a 32-bit binary mask used to divide an IP address into subnets and specify the network’s available hosts.

Iface is network card name and in my case network card is enp0s3.

👁‍🗨Now let’s check are, we able to ping Google

👉In order to ping Google use the command ping www.google.com

Here you can see we are able to ping it which means we have network connectivity.

👁‍🗨Now let’s check are, we able to ping Facebook

👉In order to ping Facebook use the command ping www.facebook.com

Here you can see we can ping Facebook…

👁‍🗨Now let’s check the IP of the Google

👉To check the google IP use command nslookup www.google.com

Here you can see an address that’s the IP of google.

👉Now delete the default routing rule

To Delete routing rule use command route -net del 0.0.0.0 enp0s3

👉Now add google IP to the routing table

Write Google Ip in Destination and gateway will be localhost and write netmask 255.255.255.0

👁‍🗨Now check if we can ping Google

👉To ping, google use the command ping www.google.com

Here you can see, we are able to ping Google…..

👁‍🗨Now check if we can ping Facebook

Here you can see, now we are not able to ping Facebook but we are able to ping google.

Task is completed successfully !!!!🤩🙌

Thanks for Reading ❗❗

🔰Keep Learning ❗❗🔰Keep Sharing ❗❗

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store