NetBSD-Users archive

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

default route on other subnet



Hi,

I need to use a gateway which is reachable by the network interface, but
not on the same subnet.  The network FAQ has a little chapter on this,
but it doesn't work here.  It's on a xen guest has a different subnet
than the linux dom0 (routing, not briding).
        ifconfig xennet0 <guest IP> netmask 255.255.255.0 up
        route add -host <dom0 IP> -link xennet0 -iface
        route add default -ifa <guest IP> <dom0 IP>
Ref http://www.netbsd.org/docs/network/#nonsubnetgateway

Note. network works with that netbsd guest otherwise (using a dummy
bridge for example)

Note. the equivalent trick works on linux guests,
        ifconfig eth0 <guest IP> netmask 255.255.255.0 up
        route add -net <dom0 IP> netmask 255.255.255.255 eth0
        route add default gw <dom0 IP>

There was also a big thread on the matter two years ago
(http://mail-index.netbsd.org/netbsd-users/2008/11/thread1.html#002409),
but I should probably avoid the common-netmask trick because I would
have to use something close to /16.  And I can't change the /24 netmask
of the dom0.

Thanks
//Pierre-Philipp


Home | Main Index | Thread Index | Old Index