Better way to get interface assigned to default route?

Markie mark.cullen at
Sat Sep 4 08:40:01 PDT 2004

Hi all,

I just now replaced my 350MHz PII home server back to the old 133MHz PI to
see if my crashing problems went away. I have noticed that dhclient-script
does a `netstat -rn | grep "^default" | awk {'print $6'}` to get the
interface that the default route is on, in my case my dsl modem is on fxp1.
Since this is a slow machine however, this takes a very long time for it to
do that command as I seem to have quite alot of...routing entries I guess
they are?

So, simple question really... does anyone else know a better way this can
be done, or is this the only way? If it's the only way i'll just change
dhclient-script so it's fixed as fxp1 and doesn't do the whole netstat -rn
thing to try and get that...


More information about the freebsd-questions mailing list