Subject: kern/797: interface host routes do not work
To: None <gnats-admin@NetBSD.ORG>
From: None <jhawk@MIT.EDU>
List: netbsd-bugs
Date: 02/13/1995 08:20:04
>Number:         797
>Category:       kern
>Synopsis:       interface host routes do not work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 13 08:20:03 1995
>Originator:     John Hawkinson
>Organization:
MIT
>Release:        1.0
>Environment:
System: NetBSD lola-granola 1.0 NetBSD 1.0 (LOLA-DDB) #66: Mon Jan 30 19:43:19 EST 1995 jtkohl@lola-granola:/u1/usr/src/sys/arch/i386/compile/LOLA-DDB i386

>Description:
	
	It would seem that it is not possible to create host, interface
	routes with the route command. That is, I would like to
	use:

route add -host 97.3.8.46 -interface 18.70.0.26

	(where 18.70.0.26 is the address of ep0) and get the following
	output out of netstat -rn:

97.3.8.46	link#1	?	?	ep0

>How-To-Repeat:

My host, lola-granola.mit.edu, is 18.70.0.26 with a mask of 255.255.0.0.
It so happens that there's a ``rogue'' host I'd like to communicate
with on the same wire with an IP address of 97.3.8.46.

My first thought was

route add -host 97.3.8.46 -interface 18.70.0.26

which produces the following (with -v):

---cut
lola-granola# route -v add -host 97.3.8.46 -interface 18.70.0.26
u: inet 97.3.8.46; u: inet 18.70.0.26; RTM_ADD: Add Route: len 108, pid: 0, seq 1, errno 0, flags:<UP,HOST>
locks:  inits: 
sockaddrs: <DST,GATEWAY>
 97.3.8.46 LOLA-GRANOLA.MIT.EDU
add host 97.3.8.46: gateway 18.70.0.26
---cut

netstat -rn shows:

---cut
Destination      Gateway            Flags     Refs     Use  Interface
default          18.70.0.1          UGS         2      180  ep0
18.70            link#1             UC          0        0  ep0
18.70.0.1        0:0:c:5:a2:33      UHL         1        0  ep0
18.70.0.26       127.0.0.1          UGHS        1       98  lo0
97.3.8.46        18.70.0.26         UH          0        0  ep0
127.0.0.1        127.0.0.1          UH          3    15205  lo0
---cut

and that fails to work. My next thought,

	route add -net 97.3.8.46 -interface 18.70.0.26

also fails to work, and produces the following output:

---cut
u: inet 97.3.8.46; u: inet 18.70.0.26; RTM_ADD: Add Route: len 116, pid: 0, seq 1, errno 0, flags:<UP>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 97.3.8.46 LOLA-GRANOLA.MIT.EDU (0) 0 ffff ffff
add net 97.3.8.46: gateway 18.70.0.26
---cut

Nevertheless, the following _does_ work:

	route add -net 97.3.8.46 -netmask 255.255.255.252 -interface 18.70.0.26

---cut
u: inet 97.3.8.46; u: inet 18.70.0.26; RTM_ADD: Add Route: len 116, pid: 0, seq 1, errno 0, flags:<UP>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 97.3.8.46 LOLA-GRANOLA.MIT.EDU (0) 0 ffff fcff
add net 97.3.8.46: gateway 18.70.0.26
---cut

	And shows the following in netstat -rn:
---cut
Destination      Gateway            Flags     Refs     Use  Interface
default          18.70.0.1          UGS         2      173  ep0
18.70            link#1             UC          0        0  ep0
18.70.0.1        0:0:c:5:a2:33      UHL         1        0  ep0
97.3.8.44        link#1             UC          0        0  ep0
127.0.0.1        127.0.0.1          UH          3    15191  lo0
---cut

I'm not sure exactly where the problem lies, and I'm not quite sure where
to start looking, so I haven't spent any time attempting to debug this.
I suppose that I ought to add a host route for 97.3.8.47 pointing to
my default gateway if I really cared about reaching that host, assuming
it ever appeared on the real Internet...

>Fix:
	See How-To-Repeat for a workaround...
>Audit-Trail:
>Unformatted: