π€ Ping Google But Not Facebook ββ
Hello Connections..!!
I Am Again Here With My New Task In The Field Of Networking
I am glad to tell you , you will definitely learn something new from this article π₯π₯π₯
If you read the main heading {π€ Ping Google But Not Facebook ββ } is it really happens or not {mazzak chal rha h kya π }
But in this Blog or Article I will show you how to ping google but not facebook
In this article you will learn lotβs of new & interesting concepts
So guys letβs start with hands on practicle!!
prerequisite for this task :- O.S {Rhel8} , network connectivity and attached to bridge adapter as shown in screenshot
Here i am using Rhel8 as a O.S ,and my network is attached to Bridged Adapter .
Task Description
Create a Setup so that you can ping google but not able to ping Facebook from same system
open your terminal and run the command mentioned below
route -n
{route -n β command is use to check the routing table and every computers , routing tables decides where their packets can go or till what range it will goes.}
Then according to the requirement connect the google by using below mention command
ping www.google.com
Here Google ip is β 172.217.160.196
Now connect with facebook for this use below mention command
ping www.facebook.com
Here Facebook ip is β 157.240.16.35
Still now you can see that we are able to connect both google as well as facebook .
But our requirement is connect to google but not able to connect with facebook.
for this you will see the picture where I run the command route -n
here see the first row where Destination and Genmask is 0.0.0.0 and in my case Gateway is 192.168.43.1 this rule is present by default in every system this is known as default gateway. Because of it we are able to connect all the ip present in the world .
and if you want to connect with google then delete this bydefault gateway .
use below mention command
route del -net 0.0.0.0
Run again below mentioned command and you will see that default gateway rule is deleted and observed google as well as facebook is not able to connected .
route -n
ping www.google.com
ping www.facebook.com
And now the Right and core concept about netmask ,gateway and genmask play big roll or come in picture.
Our requirement is connect with google for this use below mentioned command
route add -net 172.217.160.0 netmask 255.255.255.0 gw 192.168.43.1
Here in my case google ip is 172.217.160.196 which will be coming under 172.217.160.0/range
again run route -n
Our routing table is updated and google range comes under the 1st row of our routing table
now check google is pingable or not use below mentioned command
ping www.google.com
Ohh yesss one part is completed u have able to connect with google
Now check Facebook is ping or not !!
for this use below mentioned command
ping www.facebook.com
Facebook is not reachable.
and if you want to ping Facebook then use below mentioned command
In my case Facebook ip is β 157.240.16.35 and it will comes under the 157.240.16.0/24 .
route add -net 157.240.16.0 netmask 255.255.255.0 gw 192.168.43.1 enp0s3
now if u run www.facebook.com then u see Facebook is pingable.
π₯π₯ Now our requirement is successfully done !!
π€©So guys it will give you some high level idea about networking concept !!
I tried to explain as much as possible. Hope You learned Something from here. Feel free to check out my LinkedIn profile and obviously feel free to comment and give feedback also .
LINKEDIN PROFILE LINK :- https://www.linkedin.com/in/jatin-lodhi-9230571a7/