Philip Prindeville
2008-Mar-10 18:05 UTC
[Bridge] Question about using brctl and changing MAC addresses
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). What's the solution? Is there a way to explicitly set the MAC address of the bridge interface? I tried: ifconfig br0 down hw ether x:x:x:x:x:x up but that just results in: ifconfig: SIOCSIFHWADDR: Cannot assign requested address So, I'm not clear what the best solution is. Any guidance is appreciated. Thanks, -Philip
Stephen Hemminger
2008-Mar-11 15:23 UTC
[Bridge] Question about using brctl and changing MAC addresses
On Mon, 10 Mar 2008 11:05:53 -0700 Philip Prindeville <philipp_subx at 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
Srinivas M.A.
2008-Mar-13 07:24 UTC
[Bridge] Question about using brctl and changing MAC addresses
Searching for the commit by name on kernel.org: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git&a=search&h=v2.6.22-rc1&st=commit&s=allow+changing+hardware+address+to+any+valid+address and then the link to the commit page itself (from the search results): http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ffe1d49cc300f3dff990093aa952a2fbb371c1b6 Go to the "commitdiff" link and then "raw" which will give you the file you can use as a patch. On Thu, Mar 13, 2008 at 12:40 PM, Philip Prindeville <philipp_subx at redfish-solutions.com> wrote:> > Thanks. Can you send me a link so I can download it? > > -Philip >