[CentOS] Finding DHCP IP of guest system

Mon Jul 19 01:54:08 UTC 2010
Kahlil Hodgson <kahlil.hodgson at dealmax.com.au>

On 18/07/10 12:04, David Dyer-Bennet wrote:
>> An alternative, if you have some control over the DHCP server, might be
>> to enforce a mapping of MAC addresses to IPs.  You can pretty much set
>> you guest MAC addresses to whatever you want so long as they don't
>> conflict with anything else.
> In the long run, they'll be static; but at the moment the permanent IPs 
> haven't been assigned, and I'm just letting them pick something up via 
> corporate DHCP (to avoid conflicting with anything else on the network). 
>   It's at this early experimental stage that it'd be handy to find out 
> externally what they ended up being.

As a quick hack, while you experiment, you could just get the guest to
send you an email on boot with its current IP.  Say, by putting the
following at the end of your /etc/rc.local

/sbin/ip ad | /bin/mailx -s "IP details for `hostname`" <emailaddr>