[ovs-discuss] How to set the MAC address of bridge local port

Ben Pfaff blp at nicira.com
Wed Mar 4 16:53:26 UTC 2015


Almost everything there looks weird ;-)  ovs-vswitchd is obviously
trying to set the Ethernet address but initially device br0 doesn't
exist ("No such device or address") and later it can't be changed
("Operation not supported").  Something is wrong on your system but it's
not obvious what.

What does "ifconfig br0" report?

On Tue, Mar 03, 2015 at 01:07:05PM -0500, Krishna Pratap wrote:
> I did put some log statements inside bridge_pick_local_hw_addr function of
> bridge.c . it doesnt appear to set the address it picks from the bridge
> table column other-config. here are some snippet of log statements. when i
> add bridge and when i update the other-config column . anything that looks
> weird?
> 
> 2015-03-03T18:12:17.389Z|00001|vlog|INFO|opened log file
> /usr/local/var/log/openvswitch/ovs-vswitchd.log
> 2015-03-03T18:12:17.389Z|00002|vswitchd|INFO|Successfully installed crash
> handlers for ovs-vswitchd
> 2015-03-03T18:12:17.395Z|00003|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock:
> connecting...
> 2015-03-03T18:12:17.395Z|00004|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock:
> connected
> 2015-03-03T18:12:17.395Z|00005|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.1.0
> 2015-03-03T18:12:53.786Z|00006|memory|INFO|20200 kB peak resident set size
> after 36.4 seconds
> 2015-03-03T18:12:53.817Z|00007|netdev_linux|ERR|ioctl(SIOCGIFHWADDR) on br0
> device failed: No such device or address
> 2015-03-03T18:12:53.817Z|00008|bridge|INFO|bridge br0: added interface br0
> on port 65534
> 2015-03-03T18:12:53.817Z|00009|netdev|WARN|failed to set flags for network
> device br0: No such device or address
> 2015-03-03T18:12:53.817Z|00010|netdev_linux|WARN|ioctl(SIOCGIFINDEX) on br0
> device failed: No such device or address
> 2015-03-03T18:12:53.817Z|00011|bridge|ERR|bridge br0: failed to set bridge
> Ethernet address: No such device or address
> 2015-03-03T18:12:53.817Z|00012|bridge|INFO|bridge br0: using datapath ID
> 0000f2e03636694e
> 2015-03-03T18:12:53.817Z|00013|netdev_linux|WARN|br0: removing policing
> failed: No such device
> 2015-03-03T18:12:53.817Z|00014|connmgr|INFO|br0: added service controller
> "punix:/usr/local/var/run/openvswitch/br0.mgmt"
> 2015-03-03T18:13:03.818Z|00015|memory|INFO|peak resident set size grew 162%
> in last 10.0 seconds, from 20200 kB to 52932 kB
> 2015-03-03T18:13:03.818Z|00016|memory|INFO|dispatchers:1 flow_dumpers:1
> handlers:1 ports:1 revalidator keys:1 revalidators:1 rules:4
> 2015-03-03T18:13:12.655Z|00017|netdev_linux|ERR|ioctl(SIOCSIFHWADDR) on br0
> device failed: Operation not supported
> 2015-03-03T18:13:12.655Z|00018|bridge|ERR|bridge br0: failed to set bridge
> Ethernet address: Operation not supported
> 2015-03-03T18:13:12.655Z|00019|bridge|INFO|bridge br0: using datapath ID
> 0000001517a02980
> 2015-03-03T18:13:13.818Z|00020|netdev_linux|ERR|ioctl(SIOCGIFHWADDR) on br0
> device failed: No such device or address
> 
> 
> On Tue, Mar 3, 2015 at 12:54 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > What's in the ovs-vswitchd log?
> >
> > On Tue, Mar 03, 2015 at 12:51:18PM -0500, Krishna Pratap wrote:
> > > I tried bringing the port up. it doesn't change any thing. here is the
> > > output.
> > >
> > >
> > > root at ccpu5:~# ovs-vsctl  set bridge br0
> > > other-config:hwaddr=\"00:15:17:a0:29:80\"
> > > root at ccpu5:~#
> > > root at ccpu5:~#
> > > root at ccpu5:~# ovs-ofctl dump-ports-desc br0
> > > OFPST_PORT_DESC reply (xid=0x2):
> > >  LOCAL(br0): addr:16:0a:05:2e:20:bc
> > >      config:     0
> > >      state:      0
> > >      speed: 0 Mbps now, 0 Mbps max
> > > root at ccpu5:~#
> > > root at ccpu5:~#
> > > root at ccpu5:~#
> > > root at ccpu5:~# ifconfig br0
> > > br0       Link encap:Ethernet  HWaddr 16:0a:05:2e:20:bc
> > >           inet6 addr: fe80::140a:5ff:fe2e:20bc/64 Scope:Link
> > >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> > >           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> > >           TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
> > >           collisions:0 txqueuelen:0
> > >           RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)
> > >
> > >
> > > On Tue, Mar 3, 2015 at 12:46 PM, Ben Pfaff <blp at nicira.com> wrote:
> > >
> > > > On Tue, Mar 03, 2015 at 11:28:27AM -0500, Krishna Pratap wrote:
> > > > > Is it possible to set the MAC address of the local port of bridge(
> > not
> > > > the
> > > > > address of bridge itself) with a fixed address?
> > > > >
> > > > > I tried couple of ways to do it. one of them mentioned here in this
> > old
> > > > > thread
> > > > > http://openvswitch.org/pipermail/discuss/2011-June/005297.html
> > > > >
> > > > > i tested this one out but it doesn't change the mac address of port
> > br0.
> > > > > here is what I did.
> > > > >
> > > > > root at ccpu:~# ovs-vsctl add-br br0 -- set bridge br0
> > > > > other-config:hwaddr=\"00:15:17:a0:29:80\"
> > > > > root at ccpu5:~# ovs-ofctl dump-ports-desc br0
> > > > > OFPST_PORT_DESC reply (xid=0x2):
> > > > >  LOCAL(br0): addr:ce:09:03:00:00:00
> > > > >      config:     PORT_DOWN
> > > > >      state:      LINK_DOWN
> > > > >      speed: 0 Mbps now, 0 Mbps max
> > > > >
> > > > >
> > > > > As we can see the Mac address doesn't change. it does update the
> > bridge
> > > > > table's other-config column .
> > > >
> > > > I think that should work.
> > > >
> > > > I notice that the port is down.  Does it make any difference to bring
> > it
> > > > up?
> > > >
> > >
> > >
> > >
> > > --
> > > Best Regards,
> > > Krishna Pratap Singh
> >
> 
> 
> 
> -- 
> Best Regards,
> Krishna Pratap Singh



More information about the discuss mailing list