Creating a setup →A system can ping to Google but not able to ping to Facebook!

  • In this, we are going to set up a VM such that it can connect to google but not to Facebook
  • Let’s jump into the scenario
  • First, let’s delete the rule for connection.
route -n
Image for post
  • Here we have a rule — dest is neutral IP so that our VM from our gateway can go anywhere in the world.
  • Let’s ping google and Facebook and check our connectivity.
ping google.com
ping facebook.com
Image for post
Image for post
  • Now delete the rule in our routing table.
route del -net 0.0.0.0
Image for post
  • Now let’s create a rule such that only we can connect to google but not to Facebook.
route add -net 142.250.77.0 netmask 255.255.255.0 gw 192.168.43.1 enp0s3
Image for post
  • Now let’s check our connectivity whether we can ping to google or Facebook or both!
ping google.com
ping facebook.com
Image for post
we can provide any ip of the google server
Image for post
  • We can see that we are able to ping to google but unable to ping to facebook.

Thank you everyone for reading!

Written by

ARTH Learner at LinuxWorld Informatics Pvt Ltd & AL ML Developer

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