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:
- Basic knowledge of Networking.
- 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 220.127.116.11 is the IP address of Google.
18.104.22.168 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.
To view the route table:
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.
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.
To create a new table:
route add -net 22.214.171.124 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.