Giter Site home page Giter Site logo

idqdq / phpipam-scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from debops/phpipam-scripts

0.0 0.0 0.0 31 KB

A set of scripts designed to access phpIPAM database

License: GNU General Public License v3.0

Shell 1.89% Python 96.78% Makefile 1.33%

phpipam-scripts's Introduction

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

  • generate multiple host lists from one database and automatically restart DHCP server if any list changed
  • filter hosts by phpIPAM sections, subnets and host state (active, reserved, offline, dhcp)
  • check MAC address validity and automatically comment out invalid hosts in the finished configuration file
  • optionally generate host list with only invalid hosts for easier debugging

Requirements

  • Python
  • python-mysqldb
  • installed and configured phpIPAM (can be installed on a different host than phpipam-hosts)

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 [email protected]
Homepage: https://github.com/debops/phpipam-scripts/
phpIPAM homepage: http://phpipam.net/

phpipam-scripts's People

Contributors

drybjed avatar pedroberretta avatar zlyoha avatar djh00t avatar idqdq avatar the2nd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.