How to create a Setup so that you can ping Google but not able to ping Facebook from the same system
Using Network concept Routing Table
I am using RedHat Enterprise Linux 8 for this setup.
I used nslookup to fetch the IP of Google & Facebook.
nslookup www.google.com

nslookup www.facebook.com

To check the routing table.
route -n

Here I delete the default gateway. Default Gateway allows going anywhere on the internet.

route del -net 0.0.0.0
After deleting the default gateway I gave the customize gateway that only connects 216.58.196.0 Network IP only.
It means we can ping only these network IP i.e Google IP.
route add -net 216.58.196.0 netmask 255.255.255.0 gw 192.168.43.1 enp0s3
Whenever we ping Google it will easily connect.
ping 216.58.196.196

Now, if we ping except the network IP that we have given that it will unreachable.
ping 69.171.250.35
