NetBSD-Users archive

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

Re: default gateway on different subnet



Petar Bogdanovic wrote:
Hello,

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
subnet:


   ifconfig eth0 200.2.116.140 netmask 255.255.255.0

   route add -net 200.2.117.0 netmask 255.255.255.240 dev eth0
   route add default gw 200.2.117.1

How is that supposed to work? Is it to just broadcast on eth0 whenever it wants to reach 200.2.117.0/28, or is eth0 actually both 200.2.116.0/24 and 200.2.117.0/28, or is some other magic interpretation the way to look at this?

This setup looks very broken. I'm surprised that Linux would allow it.

Looking at the routing table you provided, it appears as if Linux actually pretends that eth0 are on both networks. So what you should do is setup the interface with both addresses, so that it actually knows that it's on both networks.

        Johnny



Home | Main Index | Thread Index | Old Index