1. Introduction

This guide covers installing DHCP Broadband on Linux.

Important If any step fails, do not skip the step or force the installation of any rpm package. An installation that has unmet dependencies will not operate correctly, and manual intervention will be required to complete the first time initialization process.

2. Install the OS

Install one of the supported operating systems.

3. Update the OS

Ensure that your operating system is fully updated with this command:

$ sudo yum update

4. Download the packages for your platform

wget http://www.weird-solutions.com/download/products/dhcp_broadband-retail-rhel5-i386.tar.gz
wget http://www.weird-solutions.com/download/products/dhcp_broadband-retail-rhel5-x86_64.tar.gz
wget http://www.weird-solutions.com/download/products/dhcp_broadband-retail-rhel6-i386.tar.gz
wget http://www.weird-solutions.com/download/products/dhcp_broadband-retail-rhel6-x86_64.tar.gz

wget http://www.weird-solutions.com/download/3rdparty/i686/FirebirdCS-2.1.3.18185-0.i686.rpm
wget http://www.weird-solutions.com/download/3rdparty/x86_64/FirebirdCS-2.1.3.18185-0.amd64.rpm

5. Install Extra Required Packages

sudo yum install xinetd compat-libstdc++-33 net-snmp-libs net-snmp net-snmp-utils boost-date-time boost-filesystem boost-program-options boost-regex boost-signals boost-system boost-thread libpng openssl

The stock Firebird 64 bit rpm has dependencies on two 32 bit libraries: ncurses-lib and compat-libstdc++-33. In order to install these, for 64 bit systems, use:

You may need to specify i386 instead of i686

$ sudo yum install ncurses-libs.i686
$ sudo yum install compat-libstdc++-33.i686

6. Install EPEL

Install only ONE of the following:

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

7. Install Monit

# yum install monit

Ensure that chkconfig shows monit starting on boot.

8. Install the database

Use the command below to install the database. If this step fails, double check that you have compat-libstdc++-33 installed.

sudo rpm -ivh Firebird*.rpm

9. Increase Database Connections

The default installation of Firebird does not allow enough database connections through xinetd. To remedy this, add the following two settings to the /etc/xinetd.d/firebird file (at the bottom, but before the ending '}' character):

instances = UNLIMITED
per_source = UNLIMITED

After modifying that file, restart xinetd:

$ sudo /etc/init.d/xinetd restart

10. Stop the Monit daemon

# service monit stop

This step ensures that monit does not attempt to start the daemon until installation is complete.

11. Unzip the application

Extract the rpms with this command:

tar -xzvf dhcp_broadband*.tar.gz

This will create a dhcp_broadband directory with all the RPMS.

12. Install the Packages

You can now install all of the packages with one command. In the dhcp_broadband directory, execute this command:

sudo rpm -ivh *.rpm

12.1. Manually creating a Firebird database account

Note This step is NOT NORMALLY REQUIRED. Is is only required if the previous rpm installation failed because it could not create a database account.

If the RPM package installation failed to create a Firebird database account for the DHCP server, you can create the required account manually with the following steps:

First check to see if there’s a DHCPT account in Firebird:

$ sudo grep ISC_USER /opt/firebird/SYSDBA.password
ISC_USER=sysdba
$ sudo grep ISC_PASS /opt/firebird/SYSDBA.password
ISC_PASSWD=pIRKQ8hV
$ sudo /opt/firebird/bin/gsec -display -user sysdba -password pIRKQ8hV | grep DHCPT
DHCPT                               0     0

If this user doesn’t exist, run the command below, then check that the account exists as shown in the commands above:

$ sudo /opt/firebird/bin/gsec -add dhcpt -pw dhcpt -user sysdba -password pIRKQ8hV

13. Install ntp

Install and configure ntp

14. Create log archive folders

By default, the service logs into the file /var/log/dhcptd.log. This file is periodically archived with logrotate into the dhcptd folder that you create in the step below:

$ sudo mkdir /var/log/dhcptd

15. Set DHCP Unique Server Index

Every server that will interoperate with another server must have a unique index. This index must be unique across all servers that can "see" each other.

If this is a single server install, there is no need to set the server index. The default index is 0.

To set this value in the config file /etc/dhcpt/dhcptd.conf:

system.index=0

Warning The server index may only be between 0 and 15!

16. Check service startup

At this point you should set the service to start on boot:

$ chkconfig dhcptd on
$ chkconfig wsiwebuid on

17. Start the Monit daemon

$ service monit start

Monit should start the dhcptd service for you. Check that it’s running with this command:

$ sudo service dhcptd start
$ ps axf | grep dhcptd

18. Logging In

Your DHCP service is now ready for configuration. Launch the user interface on any machine and enter the host name or ip address of the DHCP server to log in.

19. Configuring Failover (Command line interface instructions only)

Run dhcpti on the BACKUP server and enter this command:

set_system
mode=paused

Run dhcpti on the PRIMARY server and add a replication peer, assuming BACKUP is 192.168.6.6:

ON PRIMARY
insert_replicate_peer
classes=*
console_pass=
console_user=
description=
enabled=true
hb_monitor=192.168.6.6
logdir=backup1
mod_time=
target=192.168.6.6

Wait for the /var/lib/dhcptd/sync/192.168.6.6/resync directory to be removed. After removal, the backup is fully synchronized.

Run dhcpti on the BACKUP server and add a replication peer, assuming the PRIMARY is 192.168.6.3:

Note This replication peer entry is initially disabled. This bypasses full automatic resync.
ON BACKUP
insert_replicate_peer
classes=*
console_pass=
console_user=
description=
enabled=false
hb_monitor=192.168.6.3
logdir=primary1
mod_time=
target=192.168.6.3

Note the OID of the new record, then update the record:

update_replicate_peer
where=T.oid=N
enabled=true

Run dhcpti on the BACKUP and set to standby mode:

set_system
mode=standby

Failover should now be fully functional.

20. Backup and Restore

20.1. Backup a database

$ grep ISC_PASS /opt/firebird/SYSDBA.password
$ /opt/firebird/bin/gbak -g -user SYSDBA -password <password> /var/lib/dhcptd/database/dhcpt.fdb /var/lib/dhcptd/database/dhcpt.fbk

The resulting file is a backup, but it is not directly usable as a production database. Firebird will not even recognize it as a database, so you have to restore from this backup before you can use it.

Note The -g option skips garbage collection, making the backup faster.

20.2. Restore a database

$ grep ISC_PASS /opt/firebird/SYSDBA.password
$ /opt/firebird/bin/gbak -c -user SYSDBA -password <password> /var/lib/dhcptd/database/dhcpt.fbk /var/lib/dhcptd/database/dhcpt.fdb

The source file for the restore (dhcpt.fbk) must be a gbak backup file that was originally created with gbak.

21. Contact

Weird Solutions
Box 101
18622 Vallentuna
SWEDEN
tel: +46 8 758 3700
email: info at weird-solutions.com
Copyright© 1997-2015, Weird Solutions, Inc.