Is it possible to ping Google but not Facebook from the same system…🤔
Well, most of us say that we can use Firewall simply… That’s work fine, but here I do modification in my Routing Table to allow only specific site…
I’m using Redhat Linux for showing this demo…
Before starting, let’s know some about the Routing table.
A Router is a networking device that usually use to connect two or more than two different networks. This is the one which forwards data packet between different devices. For example, a router provides you internet access by connecting your LAN with the Internet.
Whenever a node sends data to another node on the network, it must first know where to send it. If the node is not directly connected, then it sends it via other nodes along a route to the destination node. Each node needs to keep track of way to deliver data, and for this, it uses a routing table.
A routing table is a database that keeps track of paths, like a map, and uses these to determine which way to forward traffic. A routing table is a data file in RAM that is used to store route information about directly connected and remote networks. Nodes can also share the contents of their routing table with other nodes.
This route table gives information of Destination IP, Gateway, Interface, Netmask, metrics, etc.
If we remove the first line of the routing table, we aren’t able to connect to the internet. So let me show my demo now…
-> Finding the IP of Google server:
For this, we use nslookup command…
-> Editing my routing table:
First I delete the row of routing table, which I use to connect to the Interet.
Now If I try to connect to the Internet, It never connects.
So let me add Google IP (which we find in the upper step) in routing table, so that we can connect to Google only.
-> Check it is pingable or not:
And let me find out the IP of Facebook/any other site and try to ping that…
You can see that it is not pingable…