What is routing:
Routing informs the kernel how to transfer a packet from one IP to another IP. Lets say you have the the following routers (gateways)
and the second level of private network under these gateways are as below
192.168.20.1 -> 10.10.10.0
192.168.20.2 -> 10.10.20.0
Let’s say you want to transfer a packet from IP 10.10.10.10 to 10.10.20.20 but by default the kernel will have the information of only 10.10.10.0/24.
To achive this and to transfer the packet to 10.10.20.20, we need to add a static route in the server, so that the kenel may know where to route this packet.
There are two types of routes: