Create a Setup so that you can ping google but not able to ping Facebook from the same system

Ritesh Singh
2 min readDec 12, 2020

--

Prerequisite

✅ You Need One VM(Virtual Machine) (Here I am using Redhat VM in VirtualBox)that has internet connectivity.

Solution 🔥

✅ Here we need to add the Rule in our OS.😉.

Step-1)Check how many Rules are there

route -n
  • Here you can see there are some rules added, so if we want some customization for our setup, First we have to remove the 0.0.0.0 rule.

Step-2)Removing Rule

route del -net 0.0.0.0
  • As You can see 0.0.0.0 removed from the destination
  • Now if you tried to ping 172.217.166.0 (GOOGLE IP) it won’t work because we have removed 0.0.0.0

Step-3)Adding Google Ip

  • So, now we need to add Google Ip.
route add -net 172.217.166.0(GOOGLE_IP) netmask 255.255.255.0 gw .192.168.0.1(Gateway) enp0s3(ETH Card)
  • Here we need to type Google Ip in the net, after that netmask and finally, we have to type Gateway.

Output 😎

  • As you can see we are pinging Google Ip.
  • Here you can see this is one of the Facebook IP, and it is not pingable because we haven’t set a rule for this Ip

--

--

Ritesh Singh
Ritesh Singh

No responses yet