<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Layer 17]]></title><description><![CDATA[Layer 17]]></description><link>https://layer-17.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 05 Jun 2026 22:56:51 GMT</lastBuildDate><atom:link href="https://layer-17.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[🖥️ Step-by-Step Guide to Installing and Configuring an IP Address Manager]]></title><description><![CDATA[An IP Address Manager (IPAM) is a tool or software solution that helps in managing, tracking, and organizing IP addresses within a network. It allows administrators to assign, monitor, and audit IP addresses efficiently, ensuring there are no conflic...]]></description><link>https://layer-17.com/how-to-install-and-configure-php-ipam</link><guid isPermaLink="true">https://layer-17.com/how-to-install-and-configure-php-ipam</guid><category><![CDATA[ipam]]></category><category><![CDATA[ip address]]></category><dc:creator><![CDATA[Jules Hageman]]></dc:creator><pubDate>Sun, 11 Aug 2024 17:15:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1723728270332/ff8b3611-08d1-4b48-91f5-5eec25906f0d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>An <strong>IP Address Manager (IPAM)</strong> is a tool or software solution that helps in managing, tracking, and organizing IP addresses within a network. It allows administrators to assign, monitor, and audit IP addresses efficiently, ensuring there are no conflicts and that the network runs smoothly. For your blog, you could use an <strong>IP Address Manager</strong> to ensure that your site's backend infrastructure is properly configured and to prevent any potential IP-related issues that might disrupt the accessibility or security of your site.</p>
<h2 id="heading-open-source-ip-address-managers">📜 Open-source IP address managers</h2>
<p>When implementing a solution to a problem, such as saving and maintaining IP addresses, I always start by looking for an open-source project that is actively maintained. Opting for open-source software offers several advantages. The main being that open-source projects are often developed by a community of contributors, ensuring that the software is continually improved and adapted to meet user needs. This community-driven approach leads to greater transparency, as the code is available for anyone to inspect, modify, and enhance, which fosters innovation and security.</p>
<h3 id="heading-what-are-the-options"><strong>🔍</strong> What are the options?</h3>
<p>The following open-source and free to use IP Address Managers (IPAMs) are available at the time of writing this article.</p>
<ol>
<li><p><strong>phpIPAM</strong>: is developed by <strong>Miha Petkovsek</strong>, a network engineer, and is now maintained by a community of contributors with regular updates and contribution from the community on its <strong>GitHub</strong> repository.</p>
</li>
<li><p><strong>NetBox</strong>: was initially developed by <strong>DigitalOcean</strong>, a cloud infrastructure provider, to manage their own infrastructure needs. <strong>NetBox</strong> continues to be actively maintained, now by a broader community of contributors, with the <strong>NetBox</strong> community and maintainers overseeing the project’s development.</p>
</li>
<li><p><strong>GestióIP</strong>: is developed by the Catalan company <strong>NEXUS-IT</strong>. The project is still maintained by <strong>NEXUS-IT</strong>, although it sees less frequent updates compared to some other IPAMs.</p>
</li>
<li><p><strong>NIPAP (Neat IP Address Planner)</strong>: was originally created by the Swedish company <strong>Spotify</strong>, specifically by staff network engineers. NIPAP is currently maintained by a small community of contributors. While not as actively updated as some others, it still receives updates and support from its users.</p>
</li>
<li><p><strong>OpenIPAM</strong>: was developed by the <strong>University of Utah’s Center for High Performance Computing</strong>. The project is primarily maintained by the University of Utah, with contributions from other users. It is still maintained, although updates are less frequent.</p>
</li>
</ol>
<p>While <strong>phpIPAM</strong> and <strong>NetBox</strong> are my favorite open-source IPAMs, we will be using <strong>phpIPAM</strong> in this tutorial.</p>
<h2 id="heading-getting-started-with-phpipam"><strong>🚀</strong> Getting started with phpIPAM</h2>
<h3 id="heading-step-1-set-up-ubuntu-vm-or-container"><strong>⚙️</strong> Step 1: Set-up Ubuntu VM or container</h3>
<p>Start by setting up the base Ubuntu 22.04 VM or container, of course you can also install Ubuntu on bare metal, meaning without a hypervisor. In this example I will be using Proxmox as the (type 1) hypervisor using the configuration down below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723800516758/156e097e-81d5-4b4d-b0f3-ba5ae8f7f2fd.jpeg" alt class="image--center mx-auto" /></p>
<h3 id="heading-step-2-configuring-ubuntu"><strong>🛠️</strong> Step 2: Configuring Ubuntu</h3>
<p>Once the base Ubuntu VM or container is configured, first step is to login in using SSH or a console session. Personally I like to change the hostname to make it descriptive of its function. You can change the default hostname by renaming the current hostname in the following configuration files.</p>
<p><em>sudo nano /etc/hostname</em><br /><em>sudo nano /etc/hosts</em></p>
<p>After that, reboot to apply the changes.<br /><em>sudo reboot</em></p>
<p>Once rebooted, update the package index and installed packages to ensure the latest (security) patches, bug fixes and latest stable features.</p>
<pre><code class="lang-bash">sudo apt update &amp;&amp; sudo apt upgrade
</code></pre>
<p>After that is done, install the packages that PHP IPAM relies on. Personally I have found issues installing all packages in one go, so these are split up.</p>
<pre><code class="lang-bash">sudo apt install curl wget zip git -y
sudo apt install apache2 mariadb-server mariadb-client -y
</code></pre>
<p>Once the packages are installed, now install all the PHP modules to be able to make phpIPAM work.</p>
<pre><code class="lang-bash">sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2 php8.2-curl php8.2-common php8.2-gmp php8.2-mbstring php8.2-gd php8.2-xml php8.2-mysql php8.2-ldap php-pear -y
</code></pre>
<ul>
<li><p>pdo, pdo_mysql : Adds support for mysql connections</p>
</li>
<li><p>session : Adds persistent session support</p>
</li>
<li><p>sockets : Adds sockets support</p>
</li>
<li><p>openssl : Adds openSSL support</p>
</li>
<li><p>gmp : Adds support for dev-libs/gmp (GNU MP library) -&gt; to calculate IPv6 networks</p>
</li>
<li><p>ldap : Adds LDAP support (Lightweight Directory Access Protocol – for AD also)</p>
</li>
<li><p>crypt : Add support for password encryption</p>
</li>
<li><p>SimpleXML: Support for SimpleXML (optional, for RIPE queries and if required for API)</p>
</li>
<li><p>json: Enable JSON support</p>
</li>
<li><p>gettext: Enables translation</p>
</li>
<li><p>filter : Adds filtering support</p>
</li>
<li><p>pcntl : Add support for process creation functions (optional, required for scanning)</p>
</li>
<li><p>cli : Enable CLI (optional, required for scanning and status checks)</p>
</li>
<li><p>mbstring : Enable mbstring support</p>
</li>
</ul>
<h3 id="heading-step-3-configuring-mariadb"><strong>🛠️</strong> Step 3: Configuring MariaDB</h3>
<p>Now execute the secure configuration of the MariaDB installation that the IPAM will store all content on. I experienced issues executing the configuration when no password is setup for the root user yet, for that reason I switched to the root user using <em>sudo su</em>.</p>
<pre><code class="lang-bash">sudo su
mysql_secure_installation
</code></pre>
<p>Now setup a secure password for the root user and follow the next steps.</p>
<pre><code class="lang-plaintext">Switch to unix_socket authentication [Y/n] y
Change the root password [Y/n] y

Now enter a secure password for the root user, twice

Remove anonymous users? [Y/n] y
Disallow root login remotely &gt; [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
</code></pre>
<p>After that is done, log in to MariaDB using the root user.</p>
<pre><code class="lang-plaintext">mysql -u root -p
</code></pre>
<p>Now its time to create a database for phpIPAM using the following commands. Where it says &lt;insert password&gt; you will need to provide the new password for the php_ipam_rw database user that we will use to configure phpIPAM with.</p>
<pre><code class="lang-plaintext">CREATE DATABASE phpipam; 
GRANT ALL PRIVILEGES ON phpipam.* TO 'php_ipam_rw'@'localhost' IDENTIFIED BY '&lt;insert password&gt;';
FLUSH PRIVILEGES; 
EXIT;
</code></pre>
<h3 id="heading-step-4-install-phpipam"><strong>🛠️</strong> Step 4: Install phpIPAM</h3>
<pre><code class="lang-plaintext">sudo git clone https://github.com/phpipam/phpipam.git /var/www/html/phpipam
cd /var/www/html/phpipam
</code></pre>
<p>Use the latest stable version</p>
<pre><code class="lang-plaintext">sudo git checkout "$(git tag --sort=v:tag | tail -n1)"
</code></pre>
<p>Change owner of phpIPAM installation folder</p>
<pre><code class="lang-plaintext">sudo chown -R www-data:www-data /var/www/html/phpipam
</code></pre>
<p>Copy the default config to the production config location. Make sure you are still in the /var/www/html/phpipam directory.</p>
<pre><code class="lang-plaintext">sudo cp config.dist.php config.php
sudo nano config.php
</code></pre>
<p>Edit the config, making sure to define the BASE variable.</p>
<pre><code class="lang-plaintext">$db['host'] = '127.0.0.1';
$db['user'] = 'php_ipam_rw';
$db['pass'] = 'Correct&amp;stable@';
$db['name'] = 'phpipam';
$db['port'] = 3306;
define('BASE', "/phpipam/");
</code></pre>
<p>Enable mod_rewrite and restart Apache</p>
<pre><code class="lang-plaintext">sudo a2enmod rewrite
sudo systemctl restart apache2
</code></pre>
<h3 id="heading-step-5-configure-phpipam"><strong>🛠️</strong> Step 5: Configure phpIPAM</h3>
<p>Browse to the phpIPAM webserver <a target="_blank" href="http://%3Cip-adres%3E/phpipam">http://&lt;ip-address&gt;/phpipam</a></p>
<p>Example: <a target="_blank" href="http://10.10.10.103/phpipam/">http://172.16.100.10/phpipam/</a></p>
<p>Click on <strong>New phpipam installation</strong></p>
<p>Click on <strong>Automatic database installation</strong></p>
<ul>
<li><p>MySQL/MariaDB username: php_ipam_rw</p>
</li>
<li><p>MySQL/MariaDB password: &lt;use the password you've setup&gt;</p>
</li>
<li><p>MySQL/MariaDB database location: 127.0.0.1</p>
</li>
<li><p>MySQL/MariaDB database name: phpipam</p>
</li>
<li><p>Advanced Options: Turn all options off (Drop existing database, Create new database, Set permissions)</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723805991000/1d5a2a70-cf22-4f6a-b6da-48a99d6e4743.jpeg" alt class="image--center mx-auto" /></p>
<p>Click on <strong>Install phpipam database</strong>, you will see a confirmation after that. Next, setup the password for the user 'Admin', setup the site title and site URL.</p>
<h3 id="heading-step-6-start-using-phpipam"><strong>🛠️</strong> Step 6: Start using phpIPAM</h3>
<p>Log in to phpIPAM with the default user 'Admin' and the password you've setup for it.</p>
<p># Backup IP address table, remove backups older than 10 days</p>
<p>crontab -e</p>
<p>@daily /usr/bin/mysqldump -u ipv6 -pipv6admin phpipam &gt; /var/www/html/phpipam/db/bkp/phpipam_bkp_$(date +"\%y\%m\%d").db</p>
<p>@daily /usr/bin/find /var/www/html/phpipam/db/bkp/ -ctime +10 -exec rm {} \;</p>
]]></content:encoded></item></channel></rss>