get virtual machine`s ip address
I`ve tried to install virt-ifconfig as well as virt-tools but failed. Is there a tool that can list all running virtual machines`s ip address like virt-ifconfig ? I`m using Fedora 16. Thanks.
On Thu, May 10, 2012 at 01:34:08AM -0700, THO HUYNH wrote:
I`ve tried to install virt-ifconfig as well as virt-tools but failed.
That's good .. the tool doesn't exist :-)
Is there a tool that can list all running virtual machines`s ip address like virt-ifconfig ?
I`m using Fedora 16.
I use: arp -an which effectively gives the same information. I think there's a way to do this from libvirt too. Note that the question is not well defined. A VM doesn't necessarily have "an" IP address. It can have none. It can have many. It can use IPv6. It can try to listen to all traffic on the bridge. It could send out packets with random source addresses. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
I`m writing 2 simple socket programs: Client program runs on guest, server program runs on host machine. The server need the dom xml name of the guest which is running the client program and the only information the server program has is the guest`s ip address. I first saw virt-ifconfig was perfect for the purpose. Is there another way to get the dom xml name of a guest from an ip address (if the ip address belongs to that guest). Tho Huynh. ________________________________ From: Richard W.M. Jones <rjones@redhat.com> To: THO HUYNH <feeliwood@yahoo.com> Cc: "libguestfs@redhat.com" <libguestfs@redhat.com> Sent: Thursday, 10 May 2012, 21:48 Subject: Re: [Libguestfs] get virtual machine`s ip address On Thu, May 10, 2012 at 01:34:08AM -0700, THO HUYNH wrote:
I`ve tried to install virt-ifconfig as well as virt-tools but failed.
That's good .. the tool doesn't exist :-)
Is there a tool that can list all running virtual machines`s ip address like virt-ifconfig ?
I`m using Fedora 16.
I use: arp -an which effectively gives the same information. I think there's a way to do this from libvirt too. Note that the question is not well defined. A VM doesn't necessarily have "an" IP address. It can have none. It can have many. It can use IPv6. It can try to listen to all traffic on the bridge. It could send out packets with random source addresses. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On Thu, May 10, 2012 at 08:24:31AM -0700, THO HUYNH wrote:
I`m writing 2 simple socket programs: Client program runs on guest, server program runs on host machine.
The server need the dom xml name of the guest which is running the client program and the only information the server program has is the guest`s ip address. [...] Is there another way to get the dom xml name of a guest from an ip address (if the ip address belongs to that guest).
CC'd to libvir-list, since this is really a libvirt question. The trouble with the architecture you've described is that it relies on the IP source address for authentication, one of those things you should never do if you care about security: https://en.wikipedia.org/wiki/IP_address_spoofing Maybe because it's TCP, and it's a closed system with a firewall, you can get away with it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Do you have any hints or ideas about my situation ? Assuming that I'm running these programs in a safe environment and I don't concern about security problems. Tho Huynh. On 11-05-2012, at 00:51, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, May 10, 2012 at 08:24:31AM -0700, THO HUYNH wrote:
I`m writing 2 simple socket programs: Client program runs on guest, server program runs on host machine.
The server need the dom xml name of the guest which is running the client program and the only information the server program has is the guest`s ip address. [...] Is there another way to get the dom xml name of a guest from an ip address (if the ip address belongs to that guest).
CC'd to libvir-list, since this is really a libvirt question.
The trouble with the architecture you've described is that it relies on the IP source address for authentication, one of those things you should never do if you care about security:
https://en.wikipedia.org/wiki/IP_address_spoofing
Maybe because it's TCP, and it's a closed system with a firewall, you can get away with it.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On 11.05.2012 02:29, Văn Thọ wrote:
Do you have any hints or ideas about my situation ? Assuming that I'm running these programs in a safe environment and I don't concern about security problems.
If you are able to get the MAC belonging to the IP address you can then grep /etc/libvirt/qemu/*.xml (assuming you are using qemu) for that MAC address. It will return the name of the guest. Michal
Tho Huynh.
On 11-05-2012, at 00:51, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, May 10, 2012 at 08:24:31AM -0700, THO HUYNH wrote:
I`m writing 2 simple socket programs: Client program runs on guest, server program runs on host machine.
The server need the dom xml name of the guest which is running the client program and the only information the server program has is the guest`s ip address. [...] Is there another way to get the dom xml name of a guest from an ip address (if the ip address belongs to that guest).
CC'd to libvir-list, since this is really a libvirt question.
The trouble with the architecture you've described is that it relies on the IP source address for authentication, one of those things you should never do if you care about security:
https://en.wikipedia.org/wiki/IP_address_spoofing
Maybe because it's TCP, and it's a closed system with a firewall, you can get away with it.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Yes. I was just thinking about that when I received your email. Thanks :) Tho Huynh. ________________________________ From: Michal Privoznik <mprivozn@redhat.com> To: Văn Thọ <feeliwood@yahoo.com> Cc: Richard W.M. Jones <rjones@redhat.com>; libvir-list@redhat.com; libguestfs <libguestfs@redhat.com> Sent: Friday, 11 May 2012, 20:27 Subject: Re: [libvirt] [Libguestfs] get virtual machine`s ip address On 11.05.2012 02:29, Văn Thọ wrote:
Do you have any hints or ideas about my situation ? Assuming that I'm running these programs in a safe environment and I don't concern about security problems.
If you are able to get the MAC belonging to the IP address you can then grep /etc/libvirt/qemu/*.xml (assuming you are using qemu) for that MAC address. It will return the name of the guest. Michal
Tho Huynh.
On 11-05-2012, at 00:51, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, May 10, 2012 at 08:24:31AM -0700, THO HUYNH wrote:
I`m writing 2 simple socket programs: Client program runs on guest, server program runs on host machine.
The server need the dom xml name of the guest which is running the client program and the only information the server program has is the guest`s ip address. [...] Is there another way to get the dom xml name of a guest from an ip address (if the ip address belongs to that guest).
CC'd to libvir-list, since this is really a libvirt question.
The trouble with the architecture you've described is that it relies on the IP source address for authentication, one of those things you should never do if you care about security:
https://en.wikipedia.org/wiki/IP_address_spoofing
Maybe because it's TCP, and it's a closed system with a firewall, you can get away with it.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (4)
-
Michal Privoznik -
Richard W.M. Jones -
THO HUYNH -
Văn Thọ