Subject: Re: default gateway "unreachable"
To: Hans Bulfone <jsb@nil.at>
From: Zdenek Salvet <salvet@ics.muni.cz>
List: tech-net
Date: 03/12/1999 10:58:25
> I'm relatively new to *BSD (but have previously used Linux on i386 and alpha)
> and have a question about routing:
>
> -----------+------------ LAN: a.a.a.56/29
> |
> | a.a.a.57
> NetBSD/alpha box
> | a.a.a.61
> |
> .
> . ethernet bridge
> .
> | b.b.b.17
> Linux router (my default gateway)
>
> I know that's not very well designed, the NetBSD box should have
> a b.b.b.x address on it's outer interface, but at the moment I have
> to live with this.
>
> Now I want to set the default gateway on the NetBSD box.
>
> route add -iface -host b.b.b.17 a.a.a.61
> route add default b.b.b.17
> Here I get an error saying that the network is unreachable. He is right
> because the interface has no ip address in the b.b.b.x net.
> I've tried using -ifa and -ifp to select the interface, but with no luck.
> I studied the /sys/net/route.c and /sys/net/rtsock.c files and found out
> that -ifa and -ifp are not relevent in the decision if the network is
> reachable or not because they are not passed to the ifa_ifwithroute
> function.
You could use "route add -net b.b.b -iface -link <interface name>".
Fix your addressing ASAP.
--
Zdenek Salvet salvet@ics.muni.cz
Ustav vypocetni techniky Masarykovy univerzity, Brno
tel.: ++420-5-41 512 257 Fax: ++420-5-41 212 747
----------------------------------------------------------------------------
If God had meant for us to be in the Army,
we would have been born with green, baggy skin.