Setting a Network rule that Will Ping to only Google.com.

Miteshdhruv
Mar 15, 2021

First check the routing table of system:

command : route -n

By seeing the above we conclude that from the gateway ip 192.168.1.1 we can route to destination ip 0.0.0.0 which means any IP in the world we can ping…..

For confirmation we can check by pinging to google.

Command : ping www.google.com

Nslookup command is used to get ip of any website.

  1. Delete the default routing information from the routing table :

command : route del -net dest_ip

Here, we can see that the 0.0.0.0 route rule is deleted.

Update the route table with new routing rule :

command : route add -net IP netmask IP gw ip enp0s3

and to check it is add or not :

command : route -n

Thats it, you have customized network rules.

Thank You for Reading !!!

--

--