Subject: Re: Routing trouble
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 04/23/2005 18:08:56
> I have this network configuration with Linux Debian:
>
> auto lo eth0
> iface lo inet loopback
> iface eth0 inet static
> address 217.20.118.121
> netmask 255.255.255.0
> up route add -net 217.20.117.0 netmask 255.255.255.0 dev eth0
> up route add default gw 217.20.117.1
> up mii-diag -A 100baseTx-FD
> ### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE
> #PRESERVED.
>
> Now, I have to move this to NetBSD.
>
> What about route -net? As I think I cannot set the defaultroute with
> "defaultroute=" in /etc/rc.conf, I added to /etc/rc.conf:
Sure you can. What's wrong with
defaultroute="217.20.117.1"
> ifconfig_fxp0="inet 217.20.118.121 netmask 0xffffff00 up"
>
> and to /etc/rc.local, I added:
>
> route add -net 217.20.117.0 -interface 217.20.118.121
I think you may want:
route add -net 217.20.117.0 -interface fxp0
> route add default 217.20.117.1
I myself would use /etc/ifconfig.fxp0. See ifconfig.if(5). You can
configure the interface there, and I think you could add your routes, too,
using the ! prefix.
I don't know what it means for an interface on network 217.20.118/24 to
have a router on 217.20.117/24. If I could, I would either change the
netmask to make the latter reachable (0xfffff000), or add an address in
/etc/ifaliases to put fxp0 on 217.20.117/24. Then I wouldn't have to muck
with route(8).
HTH.
--jkl