Ping To google.com but not to facebook.com
Create a routing table rule in such a way so that we can ping to google but not to Facebook.
In my VM by default one rule is created already to connect to anybody in the world. So using this rule I can ping google as well as Facebook so to achieve my agenda I can’t use this rule so I am going to delete this rule.
For retrieving the IPV4 of Facebook and google I will use the nslookup command.
Facebook IP is 31.13.79.35 and Google IP is 142.250.67.132 So In my routing table, I will only allow the google IP. And using gateway IP I can go to a public network from a private network.
So after adding the rule I can able to ping google and not able to ping Facebook.