Karthik Avula
3 min readDec 14, 2020

--

The Routing Table setup !

Hello everyone, welcome to an another exciting blog that demonstrates the use of Routing Table. Routing Table is the only thing that helps us to create, send, receive the internet packets.
Lets see the example that shows us one of the use case of a routing table.

Our Task would be :
We are going to setup our system that can be able to ping Google but not Facebook !

First lets see our default routing table which can be able to ping any website. Here in our default routing table we have one destination 0.0.0.0 which tells us that any IP can be our destination and Gateway here indicates the router IP and Genmask is the netmask(network name)

route -n

Here my system can be able to ping any IP. Lets try to ping www.google.com and www.facebook.com

Here using the first rule in our routing table, our system is able to ping Google, Facebook or any random website. Now we are going to delete that rule and lets see whether our system can be able to ping Google/Facebook !!

Deleted the rule which helps to create, send, receive our packets.

So our system now can’t be able to ping Google/Facebook.

While pinging Google we observed that the IP of Google is something like 172.217.XXX.XXX which tells that the Network name of Google is 255.255.0.0. Now we are going to add the rule that can be able to ping any website with 172.217.XXX.XXX Format IP(Mostly Google’s) using the same gateway(my router IP)

route add -net <Destination IP> netmask <netmask of DestinationIP> gw <Router'sIP> <YourNetworkInterface>

Lets see what happen when we try to ping www.google.com and www.facebook.com !!!

Yayyy ! Now our system is able to ping www.google.com but not www.facebook.com. Now our setup is complete.

Thanks for reading my blog. Hope you all loved this blog and I will come up next time with an another exciting blog. This blog I have written as a part of my journey in ARTH — The School of Technologies, guided by World Record Holder Mr. Vimal daga.

--

--

Karthik Avula

CS Student. Skillset : Linux, Bash Shell Scripting, Python, AWS, Hadoop, Ansible, Docker, Kuberntes, Networking and Troubleshooting, OS Concepts.