OMAPI control states for controlling dhcpd ?

Oscar Ricardo Silva oscars at mail.utexas.edu
Thu Jan 31 16:15:03 UTC 2013


We currently use this script to gracefully bring down a server after 
configuration changes:

#!/bin/sh
omshell << EOF
port 7911
key FAKEKEYFAKEKEY
connect
new control
open
set state = 2
update
EOF



The changes get made on the primary, the server is brought down with the 
above script, then restarted.  The down/up process is then repeated on 
the secondary.

We've been running into an issue where after the process is complete on 
the secondary server, the second never comes out of recover.  The 
primary is then stuck in a local state of "partner down" and a parter 
state of "Recover".  Even after completely shutting down the secondary, 
the primary still reports back with a local state of "partner down" and 
a parter state of "Recover".

One thing that was mentioned in a previous message was the possibility 
of using omshell to force a server into a "Normal" state but I'm unclear 
of the possible control states available through omshell.  In looking 
through the code I found this in dhcpd.h :


typedef enum {
         server_startup = 0,
         server_running = 1,
         server_shutdown = 2,
         server_hibernate = 3,
         server_awaken = 4
} control_object_state_t;


Are these the possible control states for dhcpd?  The "server_shutdown" 
matches what we have in the script but I'm not sure if "server_running" 
is equivalent to forcing the server into "Normal" mode.  In case it 
helps, I've attached our configs at the end of this message.


Oscar



NOTE:  We have written a patch to use the MAC address as the identifier. 
  That's why there's a configuration line: "key-off-mac-address true;"



Primary server:

option domain-name-servers 192.168.100.10, 192.168.100.11 ;
option ntp-servers 192.168.100.11, 192.168.100.10;
default-lease-time 172800;
max-lease-time 172800;
one-lease-per-client true;
ddns-update-style ad-hoc;
ddns-updates off;
authoritative;
key-off-mac-address true;
if substring (option dhcp-client-identifier, 0, 5) = 01:52:41:53:20 {
         deny booting;
}
option voip-tftp-server-address code 150 = array of ip-address ;
failover peer "dhcp" {
          primary;
          address 192.168.200.2;
          port 520;
          peer address 192.168.201.2;
          peer port 520;
          max-response-delay 60;
          max-unacked-updates 10;
          mclt 120;
	 split 255;
          load balance max seconds 5;
        }
subnet 192.168.200.0 netmask 255.255.255.224 {
	}




Secondary server:

option domain-name-servers 192.168.100.11, 192.168.100.10 ;
option ntp-servers 192.168.100.10, 192.168.100.11;
default-lease-time 172800;
max-lease-time 172800;
one-lease-per-client true;
ddns-update-style ad-hoc;
ddns-updates off;
authoritative;
key-off-mac-address true;
if substring (option dhcp-client-identifier, 0, 5) = 01:52:41:53:20 {
         deny booting;
}
option voip-tftp-server-address code 150 = array of ip-address ;
failover peer "dhcp" {
          secondary;
          address 192.168.201.2;
          port 520;
          peer address 192.168.200.2;
          peer port 520;
          max-response-delay 60;
          max-unacked-updates 10;
          load balance max seconds 5;
        }
subnet 192.168.201.0 netmask 255.255.255.224 {
	}


More information about the dhcp-users mailing list