Install Neat IP Address Planner (NIPAP) on Ubuntu 18.04 / Debian 10

NIPAP is an open source, powerful IP address management system designed to efficiently handle large numbers of IP addresses in large and small organizations. NIPAP comes with a sleek, intuitive web-based management dashboard for network engineers and SysAdmins. The web interface also has a powerful Google-style search function, but also provides a CLI client for terminal-centric users.

Features of Neat IP Address Planner

Some cool features of Neat IP Address Planner include:

  • Very fast and scales to thousands of prefixes
  • Sleek and intuitive web interface
  • Native support for IPv6 (exactly the same functionality as IPv4)
  • CLI for core users
  • Native VRF support, allowing prefixes to overlap in different VRFs
  • Support logging of a single host
  • Very powerful search function (with regular expressions)
  • Count used and available addresses
  • Comprehensive audit log
  • IP address request system for automatically assigning appropriate prefixes
  • XML-RPC middleware, allowing easy integration or writing with other applications
  • Flexible authentication using SQLite and / or LDAP

Client libraries that want to programmatically integrate with other systems provide Python, Java, and Oracle client libraries.

How to install Neat IP Address Planner on Ubuntu / Debian

NIPAP’s pre-built packages are officially available for Debian and Debian derivatives. Here are the steps you need to follow.

Step 1: Add the NIPAP repository

First add the NIPAP repository to your Ubuntu / Debian package source:

sudo apt update
sudo apt -y install gnupg2
echo "deb stable main extra" | sudo tee /etc/apt/sources.list.d/nipap.list

Add the NIPAP public key to properly authenticate the provided package:

wget -O - | sudo apt-key add -

After adding the repository, update your package list.

sudo apt -y update

Step 2: Install PostgreSQL and ip4r extension

Now we install PostgreSQL, the contrib package and the ip4r extension:

Ubuntu 18.04:

sudo apt update
sudo apt install postgresql-contrib postgresql-10-ip4r

Debian 10:

sudo apt update
sudo apt install postgresql-contrib postgresql-11-ip4r

Step 3: Install the Neat IP Address Planner (NIPAP) package on Ubuntu / Debian

The installable NIPAP software packages are:

  • Nipa -Neat IP address planner XML-RPC daemon
  • Common – Libraries with common content required by all other components
  • Nipakli – CLI Client for NIPAP
  • Nipa www – NIPAP web front end
  • python-pynipap -Python module for accessing NIPAP
  • python3-pynipap – Python 3 module for accessing NIPAP

Install the standard package using the following command:

sudo apt install nipapd nipap-cli nipap-www python-pynipap

Select to:

  • The database server is localhost
  • Set up database for nipap automatically
  • Start service automatically

I also agree to create a user for accessing the web interface.

Automatically create user for web interface? [yes/no] yes

Step 4: Configure the NIPAP Web UI

The web interface requires its own user account to authenticate to the backend and it should be a trusted account. Create it with:

sudo nipap-passwd add --username $user --password $password --name "My User Account"

The command output is as follows:

Added user nipap-www to database /etc/nipap/local_auth.db

By configuring the xmlrpc_uri variable, the Web UI can use this account:

$ sudo vim /etc/nipap/nipap.conf
xmlrpc_uri = http://nipap-www@local:StrongPassw3rd@

The configuration syntax is:

xmlrpc_uri = http://{{NIPAPD_USERNAME}}@local:{{NIPAPD_PASSWORD}}@{{NIPAPD_HOST}}:{{NIPAPD_PORT}}

Restart the nipapd service.

 sudo systemctl restart nipapd.service

You can add other user accounts in the same way:

nipap-passwd add --username myuser --password mypassword --name "my user"

Using Apache httpd with mod_wsgi to serve the web UI

First install Apache httpd using mod_wsgi:

sudo apt install apache2 libapache2-mod-wsgi

Then, add a new virtual host:

$ sudo vim /etc/apache2/sites-enabled/nipap.conf

Modify / paste the following data:

      DocumentRoot /var/cache/nipap-www/
      ServerAdmin [email protected]
      WSGIScriptAlias / /etc/nipap/www/nipap-www.wsgi

    Require all granted

    Require all granted

ErrorLog ${APACHE_LOG_DIR}/nipap_error.log
CustomLog ${APACHE_LOG_DIR}/nipap_access.log combined

Enable wsgi mod in Apache

sudo a2enmod wsgi

Verify your Apache configuration:

$ sudo apachectl configtest
Syntax OK

The web server needs to be able to write to its cache and change permissions:

sudo chown -R www-data:www-data /var/cache/nipap-www
sudo chmod -R u=rwX /var/cache/nipap-www

Now, restart the Apache httpd server:

sudo systemctl restart apache2

NIPAP Web UI should be up and running and accessible on the configured domain

Log in using the credentials provided previously.

Install Neat IP Address Planner (NIPAP) on Ubuntu 18.04 / Debian 10

Network prefixes can be added from the CLI or the web dashboard.

Configure CLI

Add CLI user:

sudo nipap-passwd add --username nipap-cli --password StrongPassword --name "My CLI user"

Then create your .nipaprc Use the username and password created above.

$ vim ~/.nipaprc
hostname = localhost
port     = 1337
username = *nipap-cli*
password = *StrongPassword*
default_vrf_rt = none
default_list_vrf_rt = all

Set file permissions:

chmod 0600 ~/.nipaprc

Try adding a test prefix to confirm it works.

$ sudo nipap address add prefix type assignment description "Test prefix"
Network added to VRF 'default' [RT: -]: Test prefix

Confirm on the UI dashboard.

Install Neat IP Address Planner (NIPAP) on Ubuntu 18.04 / Debian 10

an examination NIPAP documentation page more details.

Similar guides:

Install and configure phpIPAM on Ubuntu / Debian Linux

How to install NetBox on Ubuntu 18.04 LTS

How to install RackTables on Ubuntu