Thursday, April 14, 2011

Direct network connection to APC PDU's

Some of this information is scattered around the web, but I thought I'd put in all in one place.

In order to schedule an event on the PDU's, one has to use the web interface -- this functionality is not replicated in the serial interface.  First, I set the PDU's to request addresses on via DHCP via the serial interface, though I didn't test if that was necessary.

To connect (in my case, a MacBook) directly to the ethernet port on a PDU, one has to run a DHCP server on the laptop.  You'll need to set the ethernet port to a static IP address, in this case something along the lines of 'ifconfig en0'.

First, download the DHCP server source from ISC:  Do the usual './configure'.  There is a compile error at this time requiring editing 'dhcpctl/Makefile' to remove the -Werror from the CFLAGS macro.  Then one can 'make'.  Do not 'make install' as it will overwrite your DHCP client config.  Instead, cd to each of server, dhcpctl, and opamip, and do 'sudo make install' in each.  The APC PDU's require a very specific portion of the reply; use the following /etc/dhcpd.conf
option vendor-encapsulated-options 01:04:31:41:50:43;

subnet netmask {
    default-lease-time 300000;
    max-lease-time 350000;

Run 'sudo /usr/local/sbin/dhcpd -d en0' and watch for the DHCP requests and responses.  You will see a lease given out; point your browser to that IP address.

No comments: