Ian Pilcher
2020-Jun-12 18:00 UTC
Re: Is it possible to configure libvirt's MAC generation?
On 6/12/20 12:28 PM, Peter Crowther wrote:> Specify the MAC address as part of the domain XML for the bootstrap > node. See https://libvirt.org/formatdomain.html#elementsNICS.Unfortunately, the domain XML is created by the OpenShift installer, over which I have no control. :-( Digging into the libvirt source, it doesn't look like there's any way to configure MAC address generation. I'm now investigating whether I can mangle the source MAC of the outgoing DHCP packets with ebtables. Uugh. -- ======================================================================= In Soviet Russia, Google searches you! ========================================================================
Alvin Starr
2020-Jun-12 18:18 UTC
Re: Is it possible to configure libvirt's MAC generation?
One solution would be to dump the XML for the domain and then run something like sed on it to change what ever you want and then update the domain. Of course that will only work if the domain is stopped. On 6/12/20 2:00 PM, Ian Pilcher wrote:> On 6/12/20 12:28 PM, Peter Crowther wrote: >> Specify the MAC address as part of the domain XML for the bootstrap >> node. See https://libvirt.org/formatdomain.html#elementsNICS. > > Unfortunately, the domain XML is created by the OpenShift installer, > over which I have no control. :-( > > Digging into the libvirt source, it doesn't look like there's any way > to configure MAC address generation. I'm now investigating whether I > can mangle the source MAC of the outgoing DHCP packets with ebtables. > > Uugh. >-- Alvin Starr || land: (647)478-6285 Netvel Inc. || Cell: (416)806-0133 alvin@netvel.net ||
>======================================================================> In Soviet Russia, Google searches you! >======================================================================You can easily remove 'In Soviet Russia, '
Erik Skultety
2020-Jun-15 07:45 UTC
Re: Is it possible to configure libvirt's MAC generation?
On Fri, Jun 12, 2020 at 02:18:13PM -0400, Alvin Starr wrote:> One solution would be to dump the XML for the domain and then run something > like sed on it to change what ever you want and then update the domain. > Of course that will only work if the domain is stopped.Another one is to use the virt-xml tool to update only the part you need: virt-xml <domain> --edit --network network=default,mac.address='<new_mac>' ^This would require you to restart the domain for the change to take effect. virt-xml <domain> --update --remove device --network mac.address='<old_mac>' virt-xml <domain --update --add-device --network network=default,mac.address='<new_mac>' ^This would not, because it translates to hot-unplug and hot-plug respectively. Just an alternative to using sed. Regards, Erik