Creating a Setup So That We Can Ping Google But Not Able To Ping Facebook From Same System

Abhinav shukla
3 min readApr 1, 2021

In this article, we are going to see that how can we ping google but not facebook from the same system.

First we will check that if our system can ping to google and facebook. For this use the ping command.

Here 216.58.196.110 is the IP address of Google.

157.240.198.35 is the IP address of Facebook.

To view the route table:

route -n

What is Routing Table?

Gateways route data between networks; but all network devices, hosts as well as gateways, must make routing decisions. For most hosts, the routing decisions are simple:

  • If the destination host is on the local network, the data is delivered to the destination host.
  • If the destination host is on a remote network, the data is forwarded to a local gateway.

Because routing is network-oriented, IP makes routing decisions based on the network portion of the address. The IP module determines the network part of the destination’s IP address by applying the network mask to the address. If the destination network is the local network, the mask that is applied may be the local subnet mask. If no mask is provided with the address, the address class determines the network portion of the address.

We will delete the old route table and then we will create a new route table according to our need.

To delete route table:

route del -net 0.0.0.0

Now, we will create a new route table so that our new table will ping GOOGLE but not FACEBOOK.

Create a new table:

route add -net 216.58.196.110 netmask 255.255.255.255 gw 192.168.43.157 enp0s3

This command will create a new route table that will only ping to GOOGLE.
Let’s check our new Route Table.

Now, let’s check that if we can ping GOOGLE or not.

Now here google is pinging but not facebook.

😊Thanks For Reading😊

--

--