*** From dhcp-server -- To unsubscribe, see the end of this message. ***

So I want to see if my server is up, actually responding
to protocol messages.  I can use dhclient locally to test 
like this.  It's a long way to go but it gets you there.

NOTE: you get a broken pipe when killing the dhclient,
unless you want to hack dhclient to be a one-shot.

NOTE: on my Solaris 2.5.1 I have to use the USE_SOCKETS
define to make the server host respond to the local dhclient.

I'll set this up on the three server machines we run.
Other methods/suggestions welcome.

John Kemp ([EMAIL PROTECTED])


--- /etc/dhclient.conf ---
timeout 60;
retry 5;
reboot 10;
select-timeout 5;
initial-interval 2;
interface "hme0" {
        send host-name "network-services.uoregon.edu";
        send dhcp-client-identifier "network-services";
}

--- /etc/dhcpd.conf ---
host network-services {
   hardware ethernet 08:00:20:7B:B3:A7;
   fixed-address 128.223.60.21;
   option broadcast-address 128.223.61.255;
   option routers 128.223.60.1;
   option dhcp-client-identifier "network-services";
}

--- /etc/dhclient.script ---
/bin/true

--- a checking script ---
#!/usr/local/bin/perl5

$TIMEOUT=10;
$SIG{'ALRM'} = 'signal_handler';
alarm($TIMEOUT);
sub signal_handler { close(CLIENT); die "exiting on alarm timeout.\n"; }

$| = 1;
$requests=0;
open(CLIENT,"/usr/local/etc/dhclient -d 2\>&1 |");
while(<CLIENT>) {
   if ( /DHCPREQUEST/ ) {
      $requests++;
      die "BAD: 1st request not satisfied\n" unless ( $requests <= 1 );
   }
   if ( /DHCPACK/ ) {
      die "GOOD: we got an ack\n";
   }
}
exit;



------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dhcp/lists
If you are without web access, or if you are having trouble with the web page,
please send mail to [EMAIL PROTECTED]   Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------

Reply via email to