A Network Setup, Ping ONE but not the OTHER
Hello Everyone, In this Article, we will setup a network such that it will ping to Google servers, but it will not ping to Facebook servers.
For the Above mentioned setup we will be using Linux(RHEL Distro).
At First, we need to check our routing table. For that the command is:
- "route -n"
After having checked the routing table, we will also check and note the IPs of Google and Facebook Servers. For this we will simple use the nslookup program as:
- nslookup google.com
- nslookup facebook.com
We'll also check if both of them are now ping-able or not,
- Google Server
- Facebook Server
For disabling the connectivity to outside world, we will first remove the default gateway, i.e. 0.0.0.0 from the routing table. NOTE: After removing the default gateway the system will not be able to connect to the outside world.
Command for removing default gateway:
- route del -net 0.0.0.0
we will now add google server's IP to the routing table with the command:
- route add -net 172.217.150.0/24 gw 192.168.100.1
Now Ping Google with its IP address:
As you can see, it's successful, We can ping Google Server.
Now try pinging the Facebook Server, it will give an error like this:
The Setup is successfully completed where we can ping 1 IP but cannot ping the OTHER IP. Thanks for reading this article.