Linux – What does gateway mean in linux route table

gatewaylinuxrouting

Does it mean the next hop of the route? Can the gateway be the next next hop, if there is an internal router in the private network?

Best Answer

Does it mean the next hop of the route?

Yes, it means the next hop of the route.

Can the gateway be the next next hop, if there is an internal router in the private network

You could do that, but you must specify the route from host to gateway must go through the internal router

Example:

Host(192.168.1.10) ---> (192.168.1.1)Router(172.16.1.2) ---> (172.16.1.1)Gateway ---> NET

Then you will config in host like this:
route add -host 172.16.1.1 gw 192.168.1.1
route add default gw 172.16.1.1