From: Philip Prindeville <philipp_subx@redfish-solutions.com>
To: Andy Gospodarek <andy@greyhouse.net>
Cc: bridge@linux-foundation.org
Subject: Re: [Bridge] Question about using brctl and changing MAC addresses
Date: Wed, 12 Mar 2008 21:39:54 -0700 [thread overview]
Message-ID: <47D8B01A.4030501@redfish-solutions.com> (raw)
In-Reply-To: <bdfc5d6e0803121211g132cd5depebd3dee48f8480fa@mail.gmail.com>
Andy Gospodarek wrote:
> On Wed, Mar 12, 2008 at 2:45 PM, Philip Prindeville
> <philipp_subx@redfish-solutions.com> wrote:
>
>> Stephen Hemminger wrote:
>> > On Wed, 12 Mar 2008 10:46:48 -0400
>> > "Andy Gospodarek" <andy@greyhouse.net> wrote:
>> >
>> >
>> >> On Tue, Mar 11, 2008 at 11:29 PM, Philip Prindeville
>> >> <philipp_subx@redfish-solutions.com> wrote:
>> >>
>> >>> Stephen Hemminger wrote:
>> >>> > On Mon, 10 Mar 2008 11:05:53 -0700
>> >>> > Philip Prindeville <philipp_subx@redfish-solutions.com> wrote:
>> >>> >
>> >>> >
>> >>> >> I'm using Linux 2.6.20 (yes, I'll be upgrading to 2.6.24 as soon as it's
>> >>> >> stable).
>> >>> >>
>> >>> >> I have 4 VIA rhine ethernet controllers on my Soekris net5501, plus an
>> >>> >> ADSL PCI card (a Sangoma S-518) that runs in AAL5-SNAP mode, so it looks
>> >>> >> like an Ethernet controller.
>> >>> >>
>> >>> >> I'm trying to bridge eth0 and w1ad (the ADSL interface) into "br0". And
>> >>> >> I'm trying to force the traffic on br0 to have the MAC address that my
>> >>> >> ISP insists I use (i.e. that of the crappy little Westell 6100 modem
>> >>> >> they sent me).
>> >>> >>
>> >>> >> The issue is the following. If I do:
>> >>> >>
>> >>> >> ifconfig w1ad down hw ether x:x:x:x:x:x up
>> >>> >>
>> >>> >> followed by either:
>> >>> >>
>> >>> >> brctl addbr br0
>> >>> >> brctl addif br0 eth0
>> >>> >> brctl addif br0 w1ad
>> >>> >>
>> >>> >> or:
>> >>> >>
>> >>> >> brctl addbr br0
>> >>> >> brctl addif br0 w1ad
>> >>> >> brctl addif br0 eth0
>> >>> >>
>> >>> >> the bridge ends up taking the MAC address of eth0 either way, which I
>> >>> >> don't get (how does it decide which to use?).
>> >>> >>
>> >>> >> I can clone the same MAC address to both eth0 and w1ad, but I don't know
>> >>> >> if that would cause me any problems or not (I haven't read the STP spec
>> >>> >> in about 15 years).
>> >>> >>
>> >>> >>
>> >>> >
>> >>> > Having the same mac address on both just is going to be problematic (impossible
>> >>> > to do STP), so don't if you don't have to.
>> >>> > But you can set address of bridge and eth0 to any address you want. So set these
>> >>> > to the ISP assigned address. You probably will have to do it after bridge
>> >>> > is created.
>> >>> >
>> >>> > brctl addbr br0
>> >>> > brctl addif br0 w1ad br0
>> >>> > ifconfig eth0 hw ether x:x:x:x:x:x up
>> >>> > ifconfig w1ad up
>> >>> > ifconfig br0 hw ether x:x:x:x:x:x up
>> >>> >
>> >>> > ifconfig br0 A.B.C.D netmask 255.255.255.0
>> >>> >
>> >>>
>> >>> That seems to not work. I get:
>> >>>
>> >>> # ifconfig br0 hw ether "00:18:3A:55:15:35"
>> >>>
>> >>> ifconfig: SIOCSIFHWADDR: Cannot assign requested address
>> >>> #
>> >>>
>> >>> Any ideas why? I'm doing this before an IP address has even been
>> >>> assigned...
>> >>>
>> >
>> > Assign the hardware address of the bridge was only added in later kernels.
>> >
>>
>> Later being which kernel?
>>
>
> It looks like this commit did it:
>
> commit 4505a3ef720845b5db3ddb440de13cd4800fd508
> Author: Stephen Hemminger <shemminger@osdl.org>
> Date: Wed Dec 21 18:51:49 2005 -0800
>
> [BRIDGE]: allow setting hardware address of bridge pseudo-dev
>
> Some people are using bridging to hide multiple machines from an ISP
> that restricts by MAC address. So in that case allow the bridge mac
> address to be set to any of the existing interfaces. I don't want to
> allow any arbitrary value and confuse STP.
>
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> So that should mean it is in 2.6.15 and later (presuming this patch
> added all the needed functionality).
>
Well, I don't get it then.
I'm running Linux 2.6.20, with bridge-utils-1.2, and I'm still seeing it.
Can you send me the link to the patch, and I'll make sure it's in my
sources?
Thanks,
-Philip
>
>> And to answer the earlier question, I was doing:
>>
>> ifconfig brX down hw ether x:x:x:x:x:x up
>>
>> so yes, the interface was down when I tried to change its address.
>>
>> -Philip
>>
>>
>>
>>
next prev parent reply other threads:[~2008-03-13 4:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 18:05 [Bridge] Question about using brctl and changing MAC addresses Philip Prindeville
2008-03-11 15:23 ` Stephen Hemminger
2008-03-12 3:29 ` Philip Prindeville
2008-03-12 14:46 ` Andy Gospodarek
2008-03-12 15:14 ` Stephen Hemminger
2008-03-12 18:45 ` Philip Prindeville
2008-03-12 19:11 ` Andy Gospodarek
2008-03-13 4:39 ` Philip Prindeville [this message]
2008-03-13 7:11 ` Srinivas M.A.
2008-03-13 12:24 ` Andy Gospodarek
[not found] ` <fed120860803130008t7230f5b4m3b656d03b03cad28@mail.gmail.com>
[not found] ` <47D8D35A.6020403@redfish-solutions.com>
2008-03-13 7:24 ` Srinivas M.A.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47D8B01A.4030501@redfish-solutions.com \
--to=philipp_subx@redfish-solutions.com \
--cc=andy@greyhouse.net \
--cc=bridge@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox