can I pick anyone's brains?
ralda at gmx.de
Wed Jan 26 16:15:39 UTC 2011
Here we are again ... :-)
> If I have an IP address... 10.12.15.7 or something, is there a simple
> command I can issue from a script which will examine all the routing
> tables for me and return
> "eth0" "local"
> "eth1" "gateway"
> "tun0" "gateway"
> or something similar?
Can you please tell a bit more, what you want to achieve? The routing is
normally done by the kernel, so not required to be done in user space
programs or shell scripts.
There is one command, that allows to dump the routing table, that is the
command "route". With an awk script it would be possible to filter the
table output and select an appropriate routing entry. That way an awk
script could be used to build a command with your requirements ... else
I don't know any standard command for your purpose.
More information about the busybox