Configuring Routing Table to Ping Google but not Facebook

Archishman Ghosh
3 min readMar 13, 2021

--

Objective:

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

Introduction

In our OS, we have a Routing Table that allows us to access the Internet.

A routing table is a set of rules that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed.

So, for doing this task, we need to edit the routing table so that we can ping Google but not Facebook.

Procedure

Firstly, we are using a Redhat Enterprise Linux 8, running on a Virtual Box. Let’s move forward…

📝Checking the Routing Table

As we can see, we have an entry in the table with Destination=0.0.0.0. This says we have access to the public internet through a Gateway=192.168.43.1 which is the IP of our router.

📝Pinging

So, we can ping Google.

And, we can also ping Facebook.

📝Deleting this rule from the Routing Table

Now the 0.0.0.0 entry is deleted.

As we can see, now we can’t ping both Google & Facebook.

📝Writing a new rule

The IP of google.com is 142.250.67.46 (one of the IPs). So we need to add it in a rule.

Now, this rule is added in the Routing Table.

📝Checking the Ping

Now, we can ping google.com but cannot ping facebook.com.

This is the end of the demo. Hope this was helpful.

Thanks for reading.

--

--

Archishman Ghosh
Archishman Ghosh

Written by Archishman Ghosh

A final year engineering undergrad with a curious mind and filled with positivity. Always open-minded, ready to learn new skills and explore new domains.