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!

AWS Basics Part 02 — Amazon Elastic Compute Cloud (Amazon EC2)

Follow these easy steps to Learn the Azure Step by Step

Static type checking in Rails with Sorbet

LaCucina: What’s in the Oven?

📣 BIZVERSE WORLD MAINTENANCE📣

InShort (June 24, 2022)

Deploying Redis with Persistence on Google Kubernetes Engine

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

Welcome, Ming Zhou! ⬢ LogDNA

Scottish Books International travel fund for Scottish authors reopens

Airplane on runway preparing for takeoff with sunrise or sunset in background

ABRA CADABRA means I CREATE AS I SPEAK.

Food Waste : Fight Climate Change by Prevent It