Raspberry Pi DHCP for Avaya
Preparation:
Use the Raspberry Pi Imager to prepare a 4GB (or bigger) SD card with Raspberry PI OS lite.
Enable SSH, either with sudo raspi-config
→ “Interfacing Options”, or touch /boot/ssh
Boot up the Raspberry, connect it to the internet, and install isc-dhcp-server:
sudo apt-get update sudo apt-get install isc-dhcp-server
Also (optionally) install a TFTP server:
sudo apt-get install xinetd tftpd tftp
Disconnect the PI from the internet, and connect it to the TLAN.
TFPT configuration is covered here.
Static Address:
Servers need a static IP address, this is set up in /etc/dhcpcd.conf
:
sudo nano /etc/dhcpcd.conf
Scroll down to the eth0
section, uncomment and edit:
# Custom static IP address for eth0. interface eth0 static ip_address=192.168.0.2/24 static routers=192.168.0.254 #static domain_name_servers=192.168.0.1 8.8.8.8
Notes: 'static routers' = optional gateway address, 'static domain_name_servers' - comment out if no DNS
Save the file with Ctrl-X, Y, Enter.
Bounce ethernet port to apply:
sudo ifconfig eth0 down sudo ifconfig eth0 up
ifconfig
should now display your static IP address.
Configuring the DHCP server:
To listen on eth0, and dish out IP4 addresses, edit the config file:
sudo nano /etc/default/isc-dhcp-server
Find the following lines:
Uncomment: | DHCPDv4_CONF=/etc/dhcp/dhcpd.conf DHCPDv4_PID=/var/run/dhcpd.pid |
Edit: | INTERFACESv4=”” to INTERFACESv4=”eth0” |
Comment out: | INTERFACESv6=”” with a # sign (comment out anything IPv6) |
Save with Ctrl-X, Y, Enter.
Next, edit the dhcpd configuration file:
sudo nano /etc/dhcp/dhcpd.conf
At the top of the file, add the following:
authoritative; option nortel-callserver code 128 = string; option tftp-server-name "192.168.0.2"; # Vendor Class for i2002/i2004/1120e/1140e/1150e Internet Telephones class "Nortel-i2004-A" { match if substring (option vendor-class-identifier, 0, 14) = "Nortel-i2004-A"; option nortel-callserver "Nortel-i2004-A,192.168.0.17:4100,1,5;192.168.0.17:4100,1,5."; option vendor-class-identifier "Nortel-i2004-A"; }
Notes: 'authoritative' because its the only one, 'tftp-server-name' - enter server address if applicable
Then enter the TLAN IP subnet and range for IP phones:
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.20 192.168.0.40; option routers 192.168.0.254; }
The Nortel Option String is used to pass configuration parameters to IP sets via DHCP.
The IP address in the string is the primary (s1) and secondary (s2) Call Server Node IP address.
Save with Ctrl-X, Y, Enter.
Ok, lets see if the daemon starts, control it with:
sudo service isc-dhcp-server start | stop | restart
If you see some errors, use journalctl -xe
to get an idea why it wouldn't start, fix, and try again.
To display the current DHCP leases:
cat /var/lib/dhcp/dhcpd.leases