From: Philip Paeps on
Pascal Hambourg <boite-a-spam(a)plouf.fr.eu.org> wrote:
> Philip Paeps a écrit :
>> Pascal Hambourg <boite-a-spam(a)plouf.fr.eu.org> wrote:
>>>
>>> Actually the Linux bridge code uses the lowest MAC address of all ports.
>>> IMO that sucks, because the bridge adress may change when you add a port.
>>
>> I thought that has been made configurable. But it turns out misremember. It
>> also turns out that there's an amusing bug in the implementation. :-)
>>
>> # brctl addbr br0
>> (MAC is now random)
>> # brctl addif br0 eth0
>> (MAC is now MAC of eth0)
>> # brctl addif br0 eth1
>> (MAC is now MAC of eth0)
>> # brctl delif br0 eth0
>> (MAC is now MAC of eth1)
>> # brctl delif br0 eth1
>> (MAC is now all zeros)
>>
>> So indeed: it sucks that the address of the bridge may change, but it doesn't
>> change when you add interfaces (except for the first one).
>
> It does change when the added interface has a lower MAC address. I bet
> that eth0 has a lower address than eth1, so if you add eth1 first, then
> the bridge address will change when you add eth0.

You're right. Interesting! I had misinterpreted "lower" originally, as in
"lower in the list". This is amusing.

- Philip

--
Philip Paeps Please don't email any replies
philip(a)paeps.cx I follow the newsgroup.

Don't mess with me, I've got a laser!
-- Peter Linington, to a student who left his phone on in a lecture
From: Mark on

"Pascal Hambourg" <boite-a-spam(a)plouf.fr.eu.org> wrote in message
news:hflbno$kok$1(a)saria.nerim.net...
>> Mark <mark_cruzNOTFORSPAM(a)hotmail.com> wrote:
>>> As I understand typically the Layer2 switch may have one MAC address
>>> shared
>>> by its every port (MAC address isn't necessary for frames forwarding,
>>> but is
>>> for management functions). I would like to understand, how does the
>>> kernel
>>> treat multiport switches - it it viewed as one single NIC, or every port
>>> is
>>> a NIC for the kernel?
>
> What kind of switch are you talking about ? Hardware switch ? Linux
> bridge created with brctl ? Virtual bridge such as VDE (virtual
> distributed switch) ?

In my original post I was talking about a hardware switch.

--
Mark

From: David Schwartz on
On Dec 8, 4:21 pm, "Mark" <mark_cruzNOTFORS...(a)hotmail.com> wrote:

> In my original post I was talking about a hardware switch.

Typically, hardware switches present to Linux as two bits:

1) They present a network interface that connects to a virtual port on
the switch.

2) They present the switch itself, with the ability to configure
whatever configurable parameters each port has.

Probably the most common case is small wireless routers with built in
switches. They typically have five physical 10/100 ports on the back
of the router and one 100Mbps port connected to the CPU. Typically,
the only configuration of the switch itself is which VLANs each port
can pass and whether they're tagged or untagged. Typically, the
network interface from the CPU to the switch is in every VLAN and is
configured as sub-interfaces.

DS
From: Grant Edwards on
On 2009-12-09, Mark <mark_cruzNOTFORSPAM(a)hotmail.com> wrote:
>
> "Pascal Hambourg" <boite-a-spam(a)plouf.fr.eu.org> wrote in message
> news:hflbno$kok$1(a)saria.nerim.net...
>>> Mark <mark_cruzNOTFORSPAM(a)hotmail.com> wrote:

>>>> As I understand typically the Layer2 switch may have one MAC
>>>> address shared by its every port (MAC address isn't necessary
>>>> for frames forwarding, but is for management functions). I
>>>> would like to understand, how does the kernel treat multiport
>>>> switches - it it viewed as one single NIC, or every port is a
>>>> NIC for the kernel?
>>
>> What kind of switch are you talking about ? Hardware switch ? Linux
>> bridge created with brctl ? Virtual bridge such as VDE (virtual
>> distributed switch) ?
>
> In my original post I was talking about a hardware switch.

Then the question doesn't make any sense. The kernel doesn't
"treat it" as anything. The kernel neither knows nor cares of
its existence. A switch is not a NIC. The NIC is the Ethernet
intrface in the computer. A hardware switch is an external box
who's operation is transparent from the viewpoint of the other
devices on the network (unless it's doing layer 3 router
stuff).

--
Grant

From: Mark on

"Grant Edwards" <invalid(a)invalid.invalid> wrote in message
news:hfna18$pat$1(a)reader1.panix.com...
>> In my original post I was talking about a hardware switch.
>
> Then the question doesn't make any sense. The kernel doesn't
> "treat it" as anything. The kernel neither knows nor cares of
> its existence.

Well, I think it's obvious I was talking about Layer2 switch implemented in
ASIC. And many such chips have Linux ported on them (example - Realtek).

--
Mark