How to create a Setup so that we can ping google but will not able to ping Facebook from the same system
We will be using some basic networking and Routing Table concepts, it will be easy for you to understand too.
Starting VM and Setup…
In every system there is a routing table,
We can see the routing table is present in our VM which will allow or act as a gateway to carry our request over the Internet. we can see it using the command : route -n
We would be able to see that our VM is able to ping both google and Facebook with the current working setup.
Now we will Delete the gateway 0.0.0.0 , so that the range of IP address that comes in that range will be Unreachable. now when we try to ping either Google or Facebook will be Unreachable.
Here we can confirm and see that Google is Unreachable.
Now by adding a Rule to our Route Table we can able to Ping Google by using
Command: route add 126.96.36.199 netmask 255.255.255.0 gt 192.168.43.112 enp0s3
where enp0s3 refers to our NIC card or you can say LAN card.
gt is the Internet gateway
Awesome! , Now we will be able to ping to Google but not to Facebook.
THANK YOU !