Subject: Re: dhclient question
To: None <port-mac68k@netbsd.org>
From: William Carrel <n9640093@cc.wwu.edu>
List: port-mac68k
Date: 12/01/1998 11:03:28
Here's the voodoo dhclient way...

You should be able to configure your /etc/dhclient-script to exhibit this
behaviour.

On my system (IIcx + 10BaseT + NetBSD 1.3.2) between the lines for ifconfig and
ifaliases in /etc/netstart I run 'dhclient ae0'.  I think you'd want to add a
line in /etc/dhclient-script at line 69 which says something like echo My new
IP is: x$new_ip_address > /var/log/dhcpaddr
You could also have it mail you using:
echo My new IP is: x$new_ip_address | mail -s "'/bin/hostname' new address"
youremail@blah.com

Line 69 (/etc/dhclient-script) sits right around the following statements (in
case your file is different than the 1.3.2 dist)...
68:  if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] ||
\
69:     [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
++:    echo New IP is: x$new_ip_address | mail -s "'/bin/hostname' new address"
youremail@netbsd.org
70:    ifconfig $interface inet $new_ip_address $new_netmask_arg \
71:                                        $new_broadcast_arg $medium

Hope this helps you a little.  I'm in nearly the same boat.  I run dhclient on
boot and really have no idea where my machine is, but I have a PowerMac hooked
up to it by serial cable, so that makes it somewhat immune to address changes. 
Plus I don't have to set ttyp's as being secure (which generally is a bad
thing, if you're a security nut).  Now to just work the bugs out of ssh...

Andy <n9640093@cc.wwu.edu>

----------
>From: mcmahill@mtl.mit.edu

>ifconfig -a 

>is one way.   After the IP address is obtained, the 'ifconfig' line will
>tell you.  Not really sure where to put it in dhclient.

On Tue, 1 Dec 1998, dan dockery wrote:
>
>> Out of curiosity, does anyone know of a way I can have dhclient mail me or
>> in some other way notify me of the IP address it receives?
>> 
>> The reason I ask is that I have a Quadra 950 on which I've just installed
>> NetBSD, and as promised,  booter runs, flashes the screen, and I'm left
>> with a beautiful picture of my desktop.  Apparently at this point NetBSD is
>> running happily in the background.
>> I went back into the Installer to change my ttys file to allow root login
>> on ttyp0 and realized that I'm also going to have to run dhclient at boot
>> time.  No problem there, I'll just throw it into one of my startup
>> scripts...  but that leaves me with the question of how do I find out what
>> IP address is being used.  I'm guessing there's a way to mail it to myself,
>> but I'm afraid I'm still a bit of a novice and don't know how to manage
>> this yet.
>> 
>> TIA.
>> -Dan
>> 
>> 
>