Creating a Setup that can ping google but unable to ping Facebook from same system
Mohit Singh Tomar
DevOps Engineer | Python | Flask | Ansible | Docker | Kubernetes | Jenkins | Openshift | Shell Scripting | IOT |
In this article, I'll show you how does we can manipulate routing table of a system so that our system can ping to Google but unable to ping to the FaceBook or anyother website.
In this practicle I'm using RHEL-8 Operating System running on Oracle VirtualBox VM.
- Lets Find the Gateway ID of the system first.
- Now Lets find the IP Address of Google and FaceBook using nslookup command.
- Checking up my RHEL-8 OS is pinging to Google and FaceBook.
Here you can see that we are able to ping to Google and FaceBook both.
- Initially route table shows system can access any website in the world as you can see in this picture, which can be defined by destination ip (0.0.0.0)
- Now we use below command for manipulate the routing table.
route del -net 0.0.0.0 (For Deleting access point or disconnecting system from outside world) route add -net 172.217.166.0 netmask 255.255.255.0 gw 192.168.0.1 enp0s3 (Adding access point for the system to access only Google )
- As you can see access point to the internet world is deleted by using one of above command.
- Access point for Google server is created in routing table by using one the command given above step for adding new new IP.
- Now Lets's check wheter it is able to ping to Google and FaceBook.
By this way we can create a setup so that we can ping google but unable to ping Facebook from same system or operating system.
Thanks For Reading.....
Linkedin Profile -