You can use route get 8.8.8.8
to find out which interface and gateway on the local computer is used according to the local routing rules. The -4
and -6
options as on BSD don't work, but the -n
option for numerical output does work.
You can also use traceroute 8.8.8.8
to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).
Edit
8.8.8.8
stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8
.