Creating a network topology in which we can ping Google but not Facebook at the same time

This one is all about Creating a Network Topology such that we can ping google but not Facebook at the same time.

Firstly …Lets gather some basic info about the current working system.

We can use #ifconfig command to check Ip address and netmask of the current system.

We also have our own Routing table in the system .

By this command we can see our routing table.

This will help us to check our default gateway rule and gateway also

From this we can check that our Default Ip to go outside is 0.0.0.0 and our gateway is 192.168.1.1

Actually we need to remove this default Gateway rule from the routing table so that our system wont be able to create packets for any of the destination of outside world and will only be able to create the packets for those Destinations whose routes are added in routing table.

Now we need to check the public Ip of both google and facebook , by using the nslookup command .

Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from DNS server. It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or any other specific DNS record.

Lets check the connectivity of google and facebook by using theirs public Ip.

Since we have deleted that default rule from the routing table, we can see there is no Connectivity to both Google and Facebook .[“Network is Unreachable”]

According to task we need to ping Google only and not Facebook, so lets create a rule and add it in Routing table so that we will only be able to ping Google and not Facebook.

Here we can see this rule is added to Routing table.

Lets check the Connectivity…

So finally….we can see that system is creating packets and receiving them from www.google.com , we have a good connectivity with google.

But system is not able to create packet or ping www.facebook.com

💫Hence verified…we got desired output !!💫

--

--

Upcoming Engineer

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