I have recently started learning about pivoting and just want a confirmation about the below:
The below is a netstat output:
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default 126.96.36.199 0.0.0.0 UG 0 0 0 eth0 10.10.10.0 10.10.14.1 255.255.254.0 UG 0 0 0 tun0 10.10.14.0 0.0.0.0 255.255.254.0 U 0 0 0 tun0 10.106.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth1 10.129.0.0 10.10.14.1 255.255.0.0 UG 0 0 0 tun0 188.8.131.52 0.0.0.0 255.255.192.0 U 0 0 0 eth0
My understanding is that if we are trying to connect to a target with the ip address: 10.129.10.45 then a packet will be first sent over to the gateway i.e 10.10.14.1 and then the gateway forwards the packet to the destination 10.129.10.45.
What if there is no route for the ip address I am reaching in the routing tables? will the packet be sent over to the default gateway as a last resort?
I am guessing the default gateway belongs to the router connected to the system and thus will take any packets and forward to a destination if an ip route is not available.
Sorry, if this looks like a basic question but I have always been weak in pivoting and want to get this straight!