[libvirt] How to get the IP address of a Domain?

Eric Blake eblake at redhat.com
Wed Mar 30 20:30:12 UTC 2011


On 03/30/2011 02:18 PM, Richard W.M. Jones wrote:
>> A domain does not have an IP address. A domain is equivalent to a PC
>> in hardware, which might have none, 1 2 or more network cards, each
>> one with it's own MAC address. This is the only propertpy of the
>> hardware and can be configured via the domain XML description.  What
>> IP address your hosts uses is in complete control of your guest
>> operating system: It might configure no IP addresses at all, use a
>> mix of IPv4 and ipv4 addresses, use static assignment, or use
>> external services like DHCP, but is completely independent from the
>> hardware.  So from libvirts point of view, your domain does not have
>> an IP address.
> 
> All of the above is absolutely true.  Nevertheless you can probably
> get the IP address that a guest has chosen by reading out config files
> or (for the Windows) the Registry.

Also, it is possible to sniff network traffic to determine the IP
address of a guest, and the nwfilter implementation uses just that.  The
documentation covers some of the details and limitations of nwfilter
guessing an IP address based on traffic sniffing:

http://libvirt.org/formatnwfilter.html#nwflimitsIP

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110330/764bbb34/attachment-0001.sig>


More information about the libvir-list mailing list