From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <47D824E3.2030001@redfish-solutions.com> Date: Wed, 12 Mar 2008 11:45:55 -0700 From: Philip Prindeville MIME-Version: 1.0 References: <47D57881.2020503@redfish-solutions.com> <20080311082347.0140c4d2@extreme> <47D74E0C.7060209@redfish-solutions.com> <20080312081445.5f4c138f@extreme> In-Reply-To: <20080312081445.5f4c138f@extreme> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] Question about using brctl and changing MAC addresses List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stephen Hemminger Cc: bridge@linux-foundation.org Stephen Hemminger wrote: > On Wed, 12 Mar 2008 10:46:48 -0400 > "Andy Gospodarek" wrote: > > >> On Tue, Mar 11, 2008 at 11:29 PM, Philip Prindeville >> wrote: >> >>> Stephen Hemminger wrote: >>> > On Mon, 10 Mar 2008 11:05:53 -0700 >>> > Philip Prindeville 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? 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