Network modification!
Let us create a setup which can ping google but is unable to ping Facebook. For this we are using Redhat OS having an IP and which is connected to a router.
IPs are one of the most important concept or we can say tool commonly used in networking. In simple terms IP is a unique number given to a computer which is used to send and receive information. So basically the solution of the above mentioned task is that we will allow the IP of google and our computer to communicate and will block the IP of Facebook.
So, let’s get started!
First we will ping www.google.com using command ping -4 www.google.com!
As you can see it is pinging google.
Now we will do same to the Facebook !
Now we will check the routing table
using command route -n
Now, we delete the desired rule from the routing table using the following command,so that our computer is unable to ping google and facebook both.
route del -net 0.0.0.0 enp0s3
Now we are unable to ping google, facebook yahoo and other generic sites.
Now we will check google IP using nslookup www.google.com and will add that IP to our routing table.
As in the pic below
Now try pinging google.
Now ping facebook!
As you can see we are able to ping google but not facebook.
Hence, the task is completed successfully!