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…


route -n

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

route del -net


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 (in my case which is

route add -net gw 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)


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?


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


Food Waste : Fight Climate Change by Prevent It