All of lore.kernel.org
 help / color / mirror / Atom feed
* How to get VM IP address through XenStore
@ 2008-06-10  5:57 jian zhang
  2008-06-10  6:29 ` James Harper
  0 siblings, 1 reply; 3+ messages in thread
From: jian zhang @ 2008-06-10  5:57 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 113 bytes --]

Hi all:
I am wondering how to get current VM IP address in XenStore, does it
contains such information??

Thanks

[-- Attachment #1.2: Type: text/html, Size: 169 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: How to get VM IP address through XenStore
  2008-06-10  5:57 How to get VM IP address through XenStore jian zhang
@ 2008-06-10  6:29 ` James Harper
  2008-06-10 11:10   ` John Haxby
  0 siblings, 1 reply; 3+ messages in thread
From: James Harper @ 2008-06-10  6:29 UTC (permalink / raw)
  To: jian zhang, xen-devel

> Hi all:
> I am wondering how to get current VM IP address in XenStore, does it
> contains such information??

No, it does not. xenstore keeps layer 2 (eg MAC address) information,
but has no visibility to layer 3 (IP) and above.

What you need to do is:
1. get the mac address from xenstore
2. watch IP traffic on your network with that src or dst mac address
3. extract the IP address from that packet
4. repeat 2-3 if you suspect that there is more than one IP address
attached to that mac address.

If the mac address belongs to a router then you'll see heaps of IP
addresses attached to it, so the exercise may be futile... you should
only see one on the 'local' subnet though.

You could also try a scan of the network subnet to figure it out.

I just did a google search for "ip address from mac address" and there
are lots of people asking much the same question but I didn't come
across any useful answers.

James

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to get VM IP address through XenStore
  2008-06-10  6:29 ` James Harper
@ 2008-06-10 11:10   ` John Haxby
  0 siblings, 0 replies; 3+ messages in thread
From: John Haxby @ 2008-06-10 11:10 UTC (permalink / raw)
  To: James Harper; +Cc: jian zhang, xen-devel

James Harper wrote:
> I just did a google search for "ip address from mac address" and there
> are lots of people asking much the same question but I didn't come
> across any useful answers.
>
>   
My favourite method is "ping -b -c 1 <broadcast-addr>" and then look for 
the MAC address in /proc/net/arp.   There are numerous cases where it 
doesn't work, but it works often enough to be useful.   If you're using 
DHCP and you can get to the DHCP server you can also ask it about the 
mapping.

Finally, there's reverse ARP and rarpd which could be made to be useful 
if you could watch for ARP requests and use them to build up a 
/etc/ethers file.

jch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-10 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10  5:57 How to get VM IP address through XenStore jian zhang
2008-06-10  6:29 ` James Harper
2008-06-10 11:10   ` John Haxby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.