TASK13:- Setup To Ping Only a Particular Website Instead of All

but not able to ping Facebook from same system.

Before starting this interesting task , first let’s introduce with some basic terminologies , we will be using in this networking task .

Routing Table:-

A routing table is a set of rules that is used to determine that which rules will network packet follow ,and how they will go .The Routing table contains several information like Destination Network Name , Gateway, Netmask , Network Card Name etc.


A Netmask is a 32-bit “mask” used to divide an IP address into subnets and specify the network’s available hosts. In a netmask, two bits are always automatically assigned.


A gateway is a piece of networking hardware used in telecommunications for telecommunications networks that allows data to flow from one discrete network to another.

What we will be doing :- We will edit our route table in this way that we only can ping to Google but not to Facebook .

First of all open command line and check ip address of system by command ifconfig

now check the route table which is by default provided to our os for networking . use command route -n

now check whether in this default setting we are able to ping google or not . if yes then check its network details. use following commands

ping google.com

nslookup google.com

From here Notice IP, Server and other details

Ping Facebook too to check its connectivity

Facebook is pinging

Now we want to remove the setup so that we will not able to ping any one of them . for that use command

route del -net

Now try to ping google and facebook both . you won’t be able to ping them.

Now here the challenge come up . how to ping google .for this add 1 rule to our route table which will tell us that we can ping google with particular ip os that .

for this we need to calculate ip that to be added there . generally we use that ip which we get by ping or nslookup command than we intersect that ip with our netmask and get the ip to put in command .

here we can use 2 things .

  1. we got ip from ping google.com that is . we can intersect it with and will get and now use this in our route table

route add -net netmask gw enp0s3

2. we got ip from nslookup google.com that is172.217.174.238 . we can intersect it with and will get and now use this in our route table

route add -net netmask gw enp0s3

Now try and ping google .You will be able to ping google using both the ips and


As we can see , we are able to ping google but not Facebook .

That’s all with this article. I hope you found the post Informative, if something was missing or you think some more things could have been added, feel free to provide suggestions in the comments section.

You can check out my LinkedIn profile.



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