debops / phpipam-scripts

A set of scripts designed to access phpIPAM database
GNU General Public License v3.0
31 stars 16 forks source link

phpipam-scripts

This is a set of scripts designed to access phpIPAM database from a DHCP/DNS server.

phpipam-hosts

phpipam-hosts will let you generate customized host lists which can be included in ISC DHCP Server or dnsmasq configuration. You can also create /etc/hosts and /etc/ethers files.

To include a generated host list in any section of the ISC DHCP Server configuration, you can add in the dhcpd configuration file:

include "/path/to/host-list";

To see available configuration options, run phpipam-hosts -h

Features

Requirements

Installation

Install phpipam-hosts in a directory in your $PATH, for example /usr/local/sbin. Save provided example configuration file in /etc/dhcp/phpipam.conf and modify default database configuration to reflect your environment.

phpipam-hosts is designed to run periodically from cron, access phpIPAM database and generate specified host lists. You can either add entries with specified arguments in cron directly (run phpipam-hosts --help to see list of available options) or write your configuration in main configuration file (/etc/dhcp/phpipam.conf by default) and access it using --group option.

Example cron entry which generates a single host list and restarts dhcpd daemon if host list is changed:

*/5 * * * * root /usr/local/sbin/phpipam-hosts -o /etc/dhcp/dhcpd-hosts.conf -x

You can use an example phpipam-hosts-wrapper script to generate multiple host files and restart dhcpd if any one of them changes. To do that, you should configure different host files with the same trigger file.j

License and copyright

License: GPLv3

Copyright (C) 2014 Maciej Delmanwski drybjed@gmail.com
Homepage: https://github.com/debops/phpipam-scripts/
phpIPAM homepage: http://phpipam.net/