With the existence of the IP package in a linux/unix system the routing table can be viewed using the below command

$ ip route


root@00b74395b97a:/# ip route
default via dev eth0 dev eth0 proto kernel scope link src


That was a simple system with a single interface, But in case of having a system with too many interfaces and a longer routing table, the IP of the next hob as well as the exit interface for a specific route can e determined as following


$ ip route get

root@00b74395b97a:/# ip route get via dev eth0 src

The IP address mentioned after the keyword “via” is the IP of the next hob

While the NIC mentioned after “dev” is the exit NIC in this case it’s “eth0”

While the IP following the “src” keyword will be the IP represented in the packet as the Source IP of the request. in this case it’s “”