Ping Google But not Facebook

Rahulbhatia1998
3 min readMar 14, 2021

--

Hello everyone !!

In this article, I’m going to set up my system such that the system is able to ping Google but not able to ping Facebook.

Firstly, we will get familiar with some networking terms which we are going to use in this setup.

What is a Router?

A Router is a networking device that guides and directs network data using packets over the internet that contains various kinds of data like webpages, emails, audio, video, and many more. It is usually connected to a number of data lines from different networks. When data is sent over a network in the form of data packets, the router sends the data to the other network over some route after having a lookup from a routing table which will finally help the data packets to reach their destination.

What is a Routing Table?

A routing table is a data table that stores the routes to particular destinations and is stored in a router or a network host. Router takes the help of the routing table in order to find a route for data packets to reach the final destination.

There are some by default routing rules in the table but you can manipulate them using the following commands:

# Deletes the route
route del -net 0.0.0.0

It deletes the 0.0.0.0 route which will not all any of the traffic on the system.

# Adds the route
route add -net 0.0.0.0 gw 192.168.0.1

It adds the route with any destination IP address and gateway IP address.

What is a gateway?

Gateway is any networking device that allows the network to flow from any of the discrete networks to another. The router is an example of the gateway.

# Shows the routes
route -n

This much knowledge is enough to implement the above setup. Let’s get started with my implementation.

Let’s check the IP address of Google and Facebook using nslookup.

nslookup is for querying DNS for IP address or domain name mapping.

I got the IP address of Google and Facebook which are 142.250.67.196 and 31.13.79.35.

As you can see, I am able to ping Google and Facebook.

Now, I’m going to add Facebook’s IP address in the routing table for rejection.

# reject any IP address
route add -host ip_address reject

I’ve successfully achieved the above task as you can see in the below screenshot.

Give a clap, if you found this helpful :).

--

--

No responses yet