Developed a Setup so that we can ping Google but not able to ping Facebook from the same system.

In this article, we will create a setup in which we can ping google but cannot ping Facebook at the same time from the same system.

There are some prerequisite before we start doing practical part:

  • Knowledge of Route Tables.

First of all, we will check that If our system can ping Google and Facebook or not.

To ping, we will 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.

We can ping both Facebook and Google from the same system.

Now, we will create a setup in which we can ping google but cannot ping Facebook at the same time from the same system.

Step-1)

To view the route table:

route -n 

What is Routing Table?

The routing table contains network/next hop associations. These associations tell a routerthat a particular destination can be optimally reached by sending the packet to a specific router that represents the next hop on the way to the final destination.

All IP-enabled devices, including routers and switches, use routing tables.

Step-2)

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

Step-3)

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

To create a new table:

route add -net 216.58.196.110 netmask 255.255.255.255 gw 192.168.43.167 enp0s3

Here in this command, we will specify Google’s IP address, netmask address, and our network card IP.

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.

Here we can see that we can ping google but not Facebook.

That’s all We have created a setup that will ping GOOGLE but not FACEBOOK from the same system.

Thanks for Reading.

--

--

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
Uditanshu pandey

Technical Volunteer at ARTH-The School of Technologies || Cloud Enthusiast || Ansible ||Flutter || Hybrid Multi Cloud || DevOps || Terraform