Subject: setting static routes
To: None <netbsd-help@netbsd.org>
From: Chris Jones <chris@cjones.org>
List: netbsd-help
Date: 07/16/2002 15:50:25
This should be really simple; I must be missing something obvious.

I want to set a static route for a small network to go through another 
host.  When I try to manually create this route with "route add", 
though, it tries to run it through ppp0, instead of fxp0.

More detail:

The machine is a router and dial-up server.  It has we0 (where the 
default route goes), fxp0 (where the local net is), and several ppp 
interfaces.

# uname -a
NetBSD ns 1.5.2 NetBSD 1.5.2 (NS) #1: Wed Dec 19 15:22:25 MST 2001 
chris@ns:/usr/src/sys/arch/i386/compile/NS i386
# route add xxx.yyy.76.136 -netmask 255.255.255.248 xxx.yyy.76.104
add net xxx.yyy.76.136: gateway xxx.yyy.76.104
# netstat -nr -f inet | grep xxx.yyy.76.136
xxx.yyy.76.136/29  xxx.yyy.76.104     UGS         0        0   1500  ppp0
# route -n get xxx.yyy.76.104
    route to: xxx.yyy.76.104
destination: xxx.yyy.76.104
  local addr: xxx.yyy.76.97
   interface: fxp0
       flags: <UP,HOST,DONE,LLINFO,CLONED>
  recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu 
   expire
        0         0         0         0         0         0      1500 
     694

So, the kernel obviously knows that the correct interface to reach 
xxx.yyy.76.104 is fxp0.  But when I add a route using that as the 
next-hop gateway, it chooses ppp0 instead.  What am I missing?

Chris

-- 
------------------------------------------------- chris@cjones.org
Chris Jones                                       Mad scientist at large
   www.netbsd.org www.postgresql.org www.schemers.org www.python.org