NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

default gateway on different subnet


what is the proper NetBSD equivalent for the following two linux
route-commands in a situation where one host has not just one network
interface but also the problem that the default gateway is not on his

   ifconfig eth0 netmask

   route add -net netmask dev eth0
   route add default gw

My first guess was the following (vr0 = eth0):

   ifconfig vr0 inet netmask

   route add -net -netmask -link vr0 -iface
   route add default

but it didn't work. Unfortunately I also can't tell why exactly because
the machine is located in a datacenter far away from here and I have to
rely on a few notes made by busy technicians. What I do know is that the
NetBSD-image always boots up successfully (according to eyewitness
account ;).

After digging through the archives I also found this, but it didn't work

   ifconfig vr0 inet netmask

   route add -host -link vr0 -iface
   route add default -ifa


I tried to reproduce the scenario on a similar qemu-setup and found out
that adding the other subnet fails with `Network unreachable' while
adding a host works as expected (at least that's what `route show' told

Any help is greatly appreciated,


P.S. That's how the linux routing table looks like, when the Debian
     rescue-image is loaded:

     # route -n
     Kernel IP routing table
     Destination     Gateway         Genmask         Flags Metric Ref    Use 
Iface U     0      0        0 
eth0   U     0      0        0 
eth0         UG    0      0        0 

Home | Main Index | Thread Index | Old Index