[libvirt-users] Accessing a MAC address from inside the VM?

David Lane kg4giy at gmail.com
Tue Apr 19 12:55:26 UTC 2011


Igor,

Again, thanks for the tip.  Not a udev issue (no udev/or config file on the
guest) so it is back to manipulating the MAC by hand.

DAVID

On Mon, Apr 18, 2011 at 6:34 PM, Igor Serebryany <igor47 at moomers.org> wrote:

> On Sat, Apr 16, 2011 at 04:21:19PM -0400, David Lane wrote:
> > I attach an existing .img file to the host machine and need to change the
> > MAC address (since the image was created on another machine).  Is there a
> > way from with in the guest to do this or do I have muck with the XML?
>  And
> > if I muck with the XML and change it, how do I pass this information up
> to
> > the guest, or will the guest see it automagically or do I have to write
> it
> > down and then manually transfer it into the guest's ifcfg?
>
> The only way to change what MAC address the interface shows up with is
> to tell libvirt about the MAC you want, usually via the XML. There might
> be a way to change it after a domain is defined, but I'm not sure.
>
> > Using the GUI, when you change the NIC, the guest generally does not
> > see the new MAC and grouses until you change it.
>
> What do you mean by grouses? If you change the MAC in the XML, when your
> domain boots it will see an interface with that MAC.
>
> Do you mean that your interfaces don't come up with proper configs? Then
> your problem might be udev's persistent net rules. You have config files
> which assign IPs to eth0, for instance, but when you change the MAC
> address in the XML, eth0 disappears and you instead get an eth1 which
> comes up configured.
>
> I solve this problem by removing any persistent network name rules from
> udev. You can usually find a config file that controls such things in
> /etc/udev/rules.d
>
> --Igor
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk2svIgACgkQVyVcp2k8D/lgjwCgpb1scQCh5ACHebdMpZb2OZvU
> dX4AnjpAOha8ELRgU+ObS+eGoAKzrHPO
> =3WfH
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20110419/d3ad4995/attachment.htm>


More information about the libvirt-users mailing list