route in busybox

Rob Landley rob at
Wed Dec 7 03:54:41 UTC 2005

On Tuesday 06 December 2005 21:40, Chien-Yu Chen wrote:
> thanks for replying
> on most systems (non-busybox)
> ----------------------
> bash-2.05b$ /sbin/route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface     *        U     0      0       
> 0 wlan0 loopback        localhost       UG    0      0     
>   0 lo default         UG    0      0      
>  0 wlan0 --------------------------

Looks saneish.

> with busybox (I am using v1.01, this was from compiling buildroot)
> if the gateway to the default route has a name associated, when I do route,
> I'll get
> default       name_to_IP
> if I do route -n, I'll get
>       IP_address

Do you have /proc mounted?

> however, before I set up the new default gw, I need the IP of the old
> gw, so that I can add a -host rule to the routing table for the VPN
> server....
> hm...not sure if I made this clear enough....

It's a little fuzzy.  First check for /proc.  We're looking 
at /proc/net/route, and if it's not they're we're going to dump an empty 

Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.

More information about the busybox mailing list