Setup to ping google but not able to ping Facebook..!!
TASK DESCRIPTION:
Create a Setup so that you can ping google but not able to ping Facebook from same system.
To Make the Setup for this requirement We can do manipulation in Routing Table.
To see the routing table in the RHEL 8 Use command:
rounte -n
Here Destination 0.0.0.0 means we can ping to any destination IP in the world. Foe example we can ping to www.google.com , www.facebook.com and many more using ping command.
To remove this we use command:
route del -net 0.0.0.0/0
Now manually checking the IP’s of Google and Facebook using command:
nslookup www.google.com
Similarly nslookup www.facebook.com
So after removing we can verify again by pinging but this time it fails to ping because we removed from routing table.
Since we want to ping only to Google and not Facebook so for this we have to add the IP in the routing table using:
route add -net 172.217.167.4 netmask 255.255.255.255 gw 192.168.29.1
Now after adding this To verify we can again ping to Google and Facebook to check and this time it will ping to Google but not able to ping to Facebook.
Hence It concludes that we can do changes in Routing table according to our requirements. Here Requirement is to only ping google and don’t want to ping Facebook so we add the IP of google in routing table after deleting 0.0.0.0 IP from Routing Table.