NetBSD-Users archive

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

Re: default gateway on different subnet

On 15-Nov-2008, at 9:04 PM, Michael Kell Jensen wrote:

Well as i read the setup example in the guide, thats why we specify a route to a host and not a network. first on the network not "attached" to an outside network, uses this network settings to reach a "gateway"
Dont know if it is a proper gateway follwoing exact definitions.

Then it asks to be directed to that networks gateway _host_, with that networks, settings. So the network mask of the different networks wouldnt matter,
And the request is then led out to to a outside network.

Isnt that so?

Maybe, but your terminology is a little off and could easily lead to mistakes and misunderstandings.

An IP route is specified with a target _network_ address (specified by a network number and a netmask or a CIDR style network number and netmask bit count) and a full gateway _host_ address.

The gateway host and the source host _must_ be on the same "network", i.e. within the same subnet in order for each to be reachable (LAN- wise) by the other.

Now whether one or the other has a "larger" (fewer bits in the netmask) subnet (or different larger subnets) is effectively irrelevant to this particular pair of hosts -- they will be able to pass packets back and forth to each other because they _appear_ to be on the same common subnet. However to specify different subnet masks on different hosts connected to the same physical LAN would be stupid and it would be asking for mistakes to be made. Always subnet consistently!

Perhaps anyone who hasn't got this straight in their head yet should study ARP: how it works, and its relationship to how the LAN actually works and what it means to be able to "see" another IP on the same LAN.

These rules apply no matter how many different logical subnets are running on the same physical LAN.

An exception may be when ARP table entries are published permanently on one or more hosts on the LAN. Once you start doing that though then you're way off spec and on your own.

                                        Greg A. Woods; Planix, Inc.

Attachment: PGP.sig
Description: This is a digitally signed message part

Home | Main Index | Thread Index | Old Index