Creating a Network Topology such that you can ping Google, but not Facebook from the same system.

Step 1: The route -n command lists the routing table

  • A default route is a route that takes effect when no other route is available for an IP destination address.
  • It gives a route to a router to forward all incoming packets whose destination network addresses are not available in the routing table.
  • 0.0. 0.0 usually means the default route, i.e. the route which leads to ‘the rest of the Internet instead of somewhere on the local network.

Step 2: ping facebook.com and www.google.com

As you can see ping facebook.com and ping google.com is working and we are able to send and receive packets successfully.

Step 3: Now we will use nslookup command to look up the IP Address of Google and Facebook

Step 4: Now, Delete the default routing rule using command → route del -net 0.0.0.0

Let’s check, If we can ping google and facebook from our system

As expected, we are not able to ping either of them.

Step 5: But we have to create a setup where we could ping to google but not to facebook. So, we need to modify the routing table using the following command.

Basically, we can achieve this if we add all the IP Address ranges in the Network Netmask of google in the routing table

[As we found earlier using nslookup command the IP address of google is 172.217.174.68, So the lets create a rule that allows the Network range of 172.217.0.0/255.255.0.0]

Step 6: Check again if now we are able to ping facebook.com and google.com

As you can clearly see that ping facebook.com is still not working. But ping google.com is working as expected.

So the setup where we could ping to google and not to facebook is successfully created!

That’s all for today! I’ll be back with some new articles very soon, thanks! 🤗

Muhammad Tabish Khanday

LinkedIn: https://www.linkedin.com/in/mtabishk/

Muhammad Tabish Khanday

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deploy Java (Spring boot) application with MS-SQL database on Azure (Part 3): Using Azure CLI

What is a Graph Dtabase? Why choose Neo4J among the other Graph Databases

Open Match Deep Dive

How to set up Production-grade Airflow alerting in 5 minutes with Databand

What happens when you type “gcc main.c”

Search (grep && find) Commands

Delegators Delight— Harmony User Testing

Scaling out microservice scrum teams

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
Muhammad Tabish Khanday

Muhammad Tabish Khanday

Lets Code 💻

More from Medium

Computerized progressions have changed living souls in the beyond couple of years.

Put Your Kindle Vocabulary Into Anki Cards

A guide to migrating to a cloud era: When and why to use Kubernetes

Top 10 Technology Trends in Legal Industry

legal technology trends