Subject: Re: NetBSD as level 3 switch / routing?
To: David Laight <david@l8s.co.uk>
From: Daniel Eggert <danieleggert@mac.com>
List: netbsd-help
Date: 02/02/2003 14:34:07
On s=F8ndag, feb 2, 2003, at 13:55 Europe/Copenhagen, David Laight =
wrote:

> On Sun, Feb 02, 2003 at 01:01:31PM +0100, Daniel Eggert wrote:
>> Maybe I got it all wrong, but...
>>
>> On my gateway NetBSD box I have 3 NICs. One (sip0) is the uplink.
>>
>> I want the other two (sip1 & sip2), to have the same ip (192.168.0.1)
>> and each to connect to a separate switch. All clients on these two
>> networks should see each other. Is this possible?
>
> Short answer no, not like that.
> You need to use two different subnets for the two networks,
> eg 192.168.0.x and 192.168.1.x and ensure that the netmask on all
> the systems is set to 255.255.255.0.
>
> The gatway box has to have an address in both subnets.
> However it doesn't matter which of its addresses the clients
> use.

So, i'd use
	ifconfig sip1 inet 192.168.0.1 netmask 0xffffff00 broadcast=20
192.168.0.255
	ifconfig sip2 inet 192.168.1.1 netmask 0xffffff00 broadcast=20
192.168.1.255
and I'd have a level 3 switch.

...out of curiosity: what _if_ I (for some ridiculous reason) wanted=20
sip1 and sip2 to act as a level 1 or 2 switch. Would that be possible?

>> When I set
>> 	sysctl -w net.inet.ip.forwarding=3D1
>> will NetBSD automatically forward packets from the sip1 net to sip2 =
if
>> a client on sip1 sends ip packets to a client on sip2? (Which is
>> sometimes misleadingly called level 3 switching)
>
> Not misleading, level 1 =3D hardware, level 2 =3D MAC (ie bridge),
> level 3 =3D network (IP in this case), level 4 =3D transport (TCP or
> UDP here).

...nice, thanks.

Daniel