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

Shubh Kohli
2 min readMar 14, 2021

--

First of all ping google to check the connectivity of your system

we are able to ping google through our system which means our system is connected to a network. We are able to ping because of the rule present in routing table which allows us to connect to any server through a gateway.

We can see the rules in our routing table through command route -n

We can see the rules which says destination 0.0.0.0 i.e. user can access to any destination server through gateway that is 192.168.0.1 through enp0s3.

so we need to delete this rule if we want to ping specific servers and doesn’t allow our system to ping every or any server.

to delete any rule : route del -net 0.0.0.0

Now see the routing table, we can see that now rule has been deleted. To check whether it’s working or not, ping google and facebook.

We are not able to ping them so now we need to create a rule saying that we can ping the servers of facebook:

route add -net 157.240.198.0 netmask 255.255.255.0 gw 192.168.0.1 enp0s3

Now try to ping facebook

ping 157.240.198.35

We are able to ping facebook but not google!

--

--

Shubh Kohli
Shubh Kohli

No responses yet