Setup to ping Google but not Facebook..!!!
In this Article Am going to create a setup which can ping Google but not facebook.
đź”°Task:
Create a Setup so that you can ping google but not able to ping Facebook from same system
Pre-requisite: Basic Network concepts.
Explanation:
First open the terminal and
Use the cmd “ route -n ” to see the routing table.
đź“ŚRouting table: A routing table is a data file in RAM that is used to store route information about directly connected and remote networks. It consists of all destination IPs and its related data(netmask,gw ,n/w card etc..,).
Now I can ping Google and facebook.
It pings due to the presence of network IP 0.0.0.0 ( in routing table) which can be able to ping all possible IP addresses.
As my target is to just ping the google but not all IP’s . So, I deleted that Destination IP from routing table .
To del the specific network IP from routing table use cmd
“ route del -net <-IP->”
Now ,I tried to ping Google and facebook
But , It doesn’t pings. Due to deletion of 0.0.0.0 .
As I need to ping Google ….So, I need to add the google Ip and its gateway in Routing table.
“route add -net <IP> netmask <netmask> gateway <gw > <n/w card>”
To know the google IP use “nslookup” cmd and add the IP in Routing Table using above cmd as shown in fig.
Now , Check whether the rule is created / added in Routing table by using
“route -n” cmd .
The rule is added.
Now try to ping Google and facebook.
As we added only Google Ip ,So it pings google but in the case of facebook it fails to ping .
Similar way is also done to ping facebook too.
But my target is just to ping google but not facebook . So , the task is done.
Thank You!!!
:)