Create a Setup so that you can ping Google but not Facebook from the same system

Harshal_Atmaramani
3 min readMar 18, 2021

--

To do so, we need to modify the routing table of the System.

Routing Table

A routing table is a set of rules, often viewed in table format, that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled devices, including routers and switches, use routing tables.

  1. Check if there is network connectivity and you can see the system’s IP Address using ifconfig enp0s3 command.
  2. Then, to see the route table, use route -n command.
Step 1 & 2 Demonstration

3. Find the IP of Google and Facebook using nslookup <domain name>

Step 3 (i) Demonstration
Step 3 (ii) Demonstration

4. Delete the universal rule using the command route del -net 0.0.0.0 and then check whether it got deleted or not.

Step 4 Demonstration

5. Create a rule in the Routing Table to be able to ping to Google.

Step 5 Demonstration

6. Try to ping to Google using the command ping <IP Address of Google that you got in Step 3 (i)>. You will see that the system is able to ping to the Google’s IP Address.

Step 6 Demonstration

7. Try to do the same i.e. ping to Facebook using the command ping <IP Address of Facebook that you got in Step 3 (i)>. You will see that the system is not able to ping to the Facebook’s IP Address.

Step 7 Demonstration

Thank you for reading!
Hope it helped you.😀😄

--

--

Harshal_Atmaramani

Hi there, myself Harshal Atmaramani, ARTH Learner | ASPEN FELLOW | CTM at LiGHT Wardha, GYWS | SIH'20 Finalist | NIC'20 Regionalist | BIT Wardha