You are not logged in.

#1 2008-10-20 07:06:13

Laeffe
Member
Registered: 2008-10-20
Posts: 2

Setting MAC on bridge

Hi all.
I was trying to get this by reading the wiki, but couldn't get anything useful.

Anyway, what i want to do is (as the topics hints about) to set the mac address of a bridge interface. And of course I would like to accomplish this by using the config files.

Best Regards.

Offline

#2 2008-10-20 10:14:38

fresch
Member
Registered: 2008-08-06
Posts: 17

Re: Setting MAC on bridge

you can use

ifconfig [interface] hw ether

on bridges.
put that in rc.local or if this would be to late in the init process, put it directly
in bridge_up() in rc.d/network

Offline

#3 2008-10-20 10:43:54

fresch
Member
Registered: 2008-08-06
Posts: 17

Re: Setting MAC on bridge

/etc/rc.conf

INTERFACES=(eth0 br0)

/etc/conf.d/bridges

mac_br0="AA:BB:CC:DD:EE:FF"
BRIDGE_INTERFACES=(br0)

/etc/rc.d/network

#in bridge_up() after "brctl addbr"
eval brmac="\$mac_${br}"
/sbin/ifconfig $br hw ether $brmac || error=1

Offline

#4 2008-10-23 21:23:18

Laeffe
Member
Registered: 2008-10-20
Posts: 2

Re: Setting MAC on bridge

Some feedback.
I got this working, but i needed to put the ifconfig $br hw.. line after each of the interfaces hade been added, otherwise the MAC got changed when the if's got added.

So thanks alot fresch big_smile

Offline

Board footer

Powered by FluxBB