A set up that could ping google but not facebook from same system

So we’ve gathered here to find how to ping google but not facebook which can also mean to be able to ping only google and block all other IP’s… Let’s get started…

STEP 1:

route -n

this displays your routing table with destination 0.0.0.0 which means you are free to ping any website/any IP. So first step is to delete this entry:

route del -net 0.0.0.0

STEP 2:

Now the next step is to add google IP to our routing table to be able to ping only google and not facebook(/others). So make sure you get your google ip either by using nslookup command or by pinging to google before configuring our route table and then your gateway ip which will be available in your routing table before deleting 0.0.0.0 (in my case which is 192.168.0.1).

route add -net 216.58.196.0/24 gw 192.168.0.1 enp0s3

the above command adds certain range of IP’s along with google IP. We can cross check by using route -n. (enp0s3 — network card name)

STEP 3:

The Last step is to just to review and check.

ping www.google.com

Yes! pinging fine.. Let’s do the same with facebook

ping www.facebook.com

Finally Facebook is not pinging but google!!!

Requirement satisfied!!

Thank you!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Static Website Hosting — Leverage AWS S3 with CloudFront, Route53, ACM and Lambda@Edge!

Error Budget Is All You Need - Part 2

Best 5 Programming Language for Mobile Application Development

Flood Fill Algorithm

Useful Airbnb Links

Docker for Java Dev environment with IntelliJ and Gateway

Building A Random Bike Route Generator with Python

Gain deeper control of Rigetti quantum processors with Quil-T

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sangeeth Sahana D

Sangeeth Sahana D

More from Medium

Can we understand sentiment from just 140 characters?

Asian Leaders Alliance Newsletter #11: Happy Lunar New Year! A Year of Unity and Standing up!

AD Foreign domain | dcsync

The cross-chain IP Pallet Module is the way to expand the functionality of IP minting across the…