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

Matthias Schiffer mschiffer at universe-factory.net
Mon May 12 01:43:36 PDT 2014


>>> This should really be added as AFAICT there is currently no way to match
>>> on virtual devices like briges, TAP devices, batman-adv devices, etc...
>>> which have neither a persistent MAC address nor an ID_PATH to match on.
>>
>> So I think what we should do here is to allow MAC address (and other
>> things) to be set when creating the netdevs. I made an attempt at this
>> by generating a "predictable" one based on the interface name and the
>> machine-id. Would that do it for you, or are you after a _specific_
>> mac address, rather than just one that is always the same? I had to
>> revert the code doing this for now as there was a kernel bug, however
>> we'll hopefully get that sorted soon and then get back to this.
>>
>> Cheers,
>>
>> Tom
>>
> 
> For my usecase, a predictable, but otherwise random MAC address would
> do. But I also see that setting an arbitrary MAC address (or any other
> link parameter) for a specific virtual device is useful as well
> (especially as it is possible to do so with real devices). As virtual
> devices are almost always created with specific names, a Name= match for
> .link units would make the most sense in my opinion.
> 
> As a workaround, I've added the following udev rule to
> 80-net-setup-link.rules for now to allow matching for virtual devices
> with Path= matches:
> 
> ENV{DEVPATH}=="/devices/virtual/net/*", ENV{ID_PATH}=="",
> ENV{ID_PATH}="virtual-$kernel"
> 
> Thanks,
> Matthias
> 

Ping. There is still no way to match for virtual devices in .link units
without my workaround. Is it planned to add something similar? Would a
facility allowing to configure the MAC address of a virtual device be in
the scope of the TODO point "add reduced [Link] support to .network files"?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140512/26926cde/attachment.sig>


More information about the systemd-devel mailing list