Pinging Google but not Facebook!
So this time, I come with an interesting task.
Description: we are going to ping Google but not Facebook.
OS: RedHat Linux (you can use another Linux flavor or Windows too)
seems amazing!
Explanation: We all know that our system has its unique IP address. This IP address is known as a Private IP address (generally we don’t have our own Public IP address :( — ). In networking, Public IP can connect to Public IPs and Private IP can connect to Private IPs only. But every day we use the Internet and access public sites such as Facebook and Instagram. We connect those sites only because of the Router.
Sometimes we don’t have the router in our home so we connect our Mobile Hotspot to the system and then connect In short our mobile hotspot is also works as a router for us.
Internally our Private IP gets replaced by the public IP of the router and then the router sends the request to ISP(Internet Service Provider). When it reaches a destination it also responds back with some data packet first it reaches the router and then by exchanging IP it reaches our system and we see the site.
So without wasting any time, let’s come to our main topic : 0)
Let’s check internet connectivity first by pinging to the Google server.
Here you can see that, When I type www.google.com, This converts into IP address let’s go to that IP address.
so lets connect to Facebook from command line.
This is the routing table where our OS takes a decision to create a packet for IP or not; here you can see the default destination set it to the public(0.0.0.0) through my router gateway 192.168.43.1 so our requirement will satisfy when we change this entry;
I cleared route table so that it won’t ping to any public one. let’s quick check if it is pinging to 8.8.8.8
so here we can see because of deleting decision parameter router refuses to even creating packets also….
lets add only google server to it.
so here I added IP range to routing table lets see its pinging to Google (216.58.203.196) or not!!
Yes connectivity is absolutely fine!!
let’s try to connect to Facebook (69.171.250.35)
Yes we did it!!! we can cross check it by graphical interface also
try this on your and own and let me know if any changes require
Thank you for reading!!!✨✨
I hope you will like this😉