[systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

poma pomidorabelisima at gmail.com
Mon Jun 16 05:52:57 PDT 2014


> Whether predictable EHA may be applicable to bonding also?

To remind myself without caffeine, heh.

https://www.kernel.org/doc/Documentation/networking/bonding.txt

15. Frequently Asked Questions

8.  Where does a bonding device get its MAC address from?

	When using slave devices that have fixed MAC addresses, or when
the fail_over_mac option is enabled, the bonding device's MAC address is
the MAC address of the active slave.

	For other configurations, if not explicitly configured (with
ifconfig or ip link), the MAC address of the bonding device is taken from
its first slave device.  This MAC address is then passed to all following
slaves and remains persistent (even if the first slave is removed) until
the bonding device is brought down or reconfigured.

	If you wish to change the MAC address, you can set it with
ifconfig or ip link:

# ifconfig bond0 hw ether 00:11:22:33:44:55

# ip link set bond0 address 66:77:88:99:aa:bb

	The MAC address can be also changed by bringing down/up the
device and then changing its slaves (or their order):

# ifconfig bond0 down ; modprobe -r bonding
# ifconfig bond0 .... up
# ifenslave bond0 eth...

	This method will automatically take the address from the next
slave that is added.

	To restore your slaves' MAC addresses, you need to detach them
from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
then restore the MAC addresses that the slaves had before they were
enslaved.


poma




More information about the systemd-devel mailing list