Programmatic way to find interface

Manuel Arostegui Ramirez manuel at todo-linux.com
Sun Nov 12 11:59:14 UTC 2006


El Domingo, 12 de Noviembre de 2006 12:09, Neal Becker escribió:
> What is a programmatic way to find out what interface is associated with
> the default route?
>
> I know this could be done by parsing /proc/sys/net/route, but is there a
> more elegant solution?

This works for me

route | grep "default" | awk ' {print $8}'


-- 
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.




More information about the fedora-list mailing list