Create a Setup so that you can ping google but not able to ping Facebook from same system
Task Description
?? Create a Setup so that you can ping google but not able to ping Facebook from same system.
For performing the above task,we need to work on the rules present the route table. The packets are only generated according to the rules in the route table.
Let's proceed with the task.
STEP 1 : Start the system. I have used the system with the IP shown below:
STEP 2 : Check the route table using the command "route -n". Also check whether we are able to ping both google and facebook initially or not using "ping" command.
Successfully ping google:
Successfully ping facebook:
STEP 3 : Create a rule using IP, netmask, and gateway by which we are able to ping only google and not Facebook using the command "route add"
But before that we have to remove a Universal IP 0.0.0.0 from the routing table using the command "route del -net 0.0.0.0". Refer below the rule for the 0.0.0.0 IP has been deleted:
Now let's create rule by which we can ping only google and not facebook. The command used : route add -net 172.217.160.0 netmask 255.255.255.0 gw 192.168.0.1 enp0s3
STEP 4: We are done. Let's check whether the objective of the task is achieved or not.
PING Google using ping command: It's successful.
PING Facebook using ping command : Failed!! Getting error "no route"
We can see from the above images that we are able to ping google because we created a rule for it in the routing table but not facebook. The reason is the packets are only generated based on the rule of routing table. We don't have any rule for facebook so we can not ping facebook.
DONE !!
Hope you found this article interesting.
Sr. DevOps Engineer @Mindbowser | 1x AWS | CKA, CKAD , DO180 , RHCSA, RH294 Trained | DevSecOps | KOps | GitOps | DevOps
4 年Well done ?? Jasprit Kaur