Subject: Re: strange routing behavior: wrong route picked
To: None <itojun@iijlab.net>
From: Tad Hunt <tad@entrisphere.com>
List: tech-kern
Date: 11/05/2002 19:14:14
with "-host" it still picks the default route.  
with "-netmask 0xffffffff" it gave me an error "Invalid
argument", which went away if I specified the address
before the "-netmask 0xffffffff" but it still picks the
default route. Output is attached below.


Thanks,
	-Tad

In message <20021106013059.C5FFC4B22@coconut.itojun.org>, you said:
;>I've attached what I think is the relevant output below.
;>
;>Notice the route for 192.168.1.1, which should be reachable via
;>interface tun8.  For some reason that I cannot fathom, "route get
;>192.168.1.1" tells me that it's using the default route out the
;>"fe0" interface, instead of the the more specific route (which
;>appears to be marked UP) as far as I can tell.
;
;	any differences if you add "-host" or "-netmask"?
;	% route -n get -host 192.168.1.1
;	% route -n get -netmask 0xffffffff 192.168.1.1
;
;itojun

# route -n get -host 192.168.1.1
   route to: 192.168.1.1
destination: default
       mask: default
    gateway: 192.168.167.1
 local addr: 192.168.167.153
  interface: fe0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 
# route -n get -netmask 192.168.1.1
writing to routing socket: Invalid argument
# route -n get 192.168.1.1 -netmask 0xffffffff
   route to: 192.168.1.1
destination: default
       mask: default
    gateway: 192.168.167.1
 local addr: 192.168.167.153
  interface: fe0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 
#