9

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

 2 years ago
source link: https://computingforgeeks.com/install-neat-ip-address-planner-on-ubuntu-debian/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Install Neat IP Address Planner(NIPAP) on Ubuntu 20.04/18.04 & Debian 10

NIPAP is an open source and powerful IP address management system built to efficiently handle large amounts of IP addresses in small to large organizations. NIPAP comes with a sleek and intuitive web based management dashboard for Network engineers and SysAdmins to use. The web interface also features a powerful Google-style search, but a CLI client is also provided for terminal centric users. This short tutorial will show you how to install Neat IP Address Planner(NIPAP) on Ubuntu 20.04/18.04 & Debian 10.

Features of Neat IP Address Planner

Some of the cool features of Neat IP Address Planner include:

  • Very fast and scalable to hundreds of thousands of prefixes
  • A stylish and intuitive web interface
  • Native support for IPv6 (full feature parity with IPv4)
  • CLI for the hardcore user
  • Native VRF support, allowing overlapping prefixes in different VRFs
  • Support for documenting individual hosts
  • Very powerful search function (featuring regexp)
  • Statistics over used and free addresses
  • Integrated audit log
  • IP address request system for automatically assigning suitable prefixes
  • XML-RPC middleware, allowing easy integration with other applications or writing
  • Flexible authentication using SQLite and/or LDAP

Client libraries for Python, Java and Oracle are available for those that want to integrate with other systems programmatically.

Install Neat IP Address Planner on Ubuntu / Debian

The NIPAP pre-built packages are officially provided for Debian and Debian derivatives. Here are the how to steps you need to follow.

Step 1: Add NIPAP repo

Start by adding the NIPAP repository to your Ubuntu/Debian package sources:

sudo apt update
sudo apt -y install gnupg2
echo "deb http://spritelink.github.io/NIPAP/repos/apt stable main extra" | sudo tee /etc/apt/sources.list.d/nipap.list

Add the NIPAP public key for proper authentication of the packages provided:

wget -O - https://spritelink.github.io/NIPAP/nipap.gpg.key | sudo apt-key add -

Once the repository is added, update your package lists.

sudo apt -y update

Step 2: Install PostgreSQL and ip4r extension

Let’s now install the PostgreSQL, the contrib package and the ip4r extension:

Ubuntu 20.04:

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

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 Neat IP Address Planner (NIPAP) packages on Ubuntu / Debian

The NIPAP packages installable are:

  • nipapd – Neat IP Address Planner XML-RPC daemon
  • nipap-common – A library with common stuff needed by all the other components
  • nipap-cli – A CLI client for NIPAP
  • nipap-www – A web frontend for NIPAP
  • python-pynipap – Python module for accessing NIPAP
  • python3-pynipap – Python 3 module for accessing NIPAP

Install the standard packages with the command:

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

Select to:

  • Database server is localhost
  • Automatically set up the database for nipapd
  • Automatically start the services

Also agree to create a user for accessing the web interface.

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

Step 4: Configure NIPAP Web UI

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

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

Command output is like this:

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

Configure the web UI to use this account by configuring the xmlrpc_uri variable:

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

The configuration syntax is:

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

Restart nipapd service.

 sudo systemctl restart nipapd.service

Other user accounts can be added using same method:

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

Serving the web UI with Apache httpd with mod_wsgi

Begin by installing Apache httpd with 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 below data:

<VirtualHost *:80>
      ServerName nipap.example.com
      DocumentRoot /var/cache/nipap-www/
      ServerAdmin [email protected]
      WSGIScriptAlias / /etc/nipap/www/nipap-www.wsgi

<Directory /etc/nipap/www/>
    Require all granted
</Directory>

<Directory /var/cache/nipap-www/>
    Require all granted
</Directory>

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

Enable wsgi mod in Apache

sudo a2enmod wsgi

Validate your Apache configurations:

$ sudo apachectl configtest
Syntax OK

The web server needs to be able to write to its cache, alter the permissions :

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

Now, restart Apache httpd server:

sudo systemctl restart apache2

The NIPAP web UI should be up and running and accessible on configured domain nipap.example.com.

Login with the credentials provided earlier.

Network prefixes can be added from CLI or web dashboard.

Configuring CLI

Add CLI user:

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

Then create your .nipaprc with username and password created above.

$ vim ~/.nipaprc
[global]
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 test prefix to confirm it works.

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

Confirm on UI Dashboard.

Check the NIPAP Documentation page for 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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK