When running a VoIP PBX, Dynamic Host Configuration Protocol (DHCP) servers play an important part in the configuration of the network and of the IP phones. We'll by start discussing the basic operation of DHCP.
VoIP and DHCP
The alternative is to manually assign static IP addresses to each device and then when it moves to another location, reassign another static IP address. This would be a lot of work for mobile devices such as cellphones, laptops, PDAs, iPads, iPods and WiFi devices.
How does DHCP work?
When a device, like a PC, first connects to a network it follows this process:
The IP addresses are pulled from a pool of IP addresses that the network administrator has assigned to that particular network. The pool excludes static IP addresses that would be assigned to network devices that are always on such as routers, switches, wireless access points and servers.
Why lease IP addresses?
The lease time can be any length of time from a few minutes to several days, weeks or permanently. In the post secondary institute that I work at. The lease time is 50 minutes which corresponds to one "hour" of class time. This prevents the IP pool from being used up for any one classroom.
Another reason would be to make it more difficult for rogue servers to be setup where there is public access. It is difficult (but not impossible) to access a server if the IP address is changing every 50 minutes.
Basic DHCP assigns:
When an IP phone boots up, it contacts a DHCP server to receive an IP address and information specfic to the network that it is on. You have a choice with an IP phone to manually configure the phone either through a web interface or through a user interface (LCD). This would work fine if you have a small phone system with a couple of phones. But what if you had 100s of phones and you had to make a change or update firmware? This is where DHCP shines!
One of the options that DHCP can assign to an IP phone is the IP address of a tftp server (Option 66 or 150). The tftp server holds the PBX configuration information for the phone and the firmware that the phone should load. PBX software such as the Endpoint Manager module in FreePBX, allows you to remotely configured your IP phone, tell it to reboot and load a new configuration or even new firmware. And you can reconfigure all the phones in your network at the same time. It is a great time saver!
When creating a DHCP server, you are allowed to configure extra "options" that can be passed to clients. One that was mentioned early is option 66 or 150 which is the IP address of a tftp server that can hold the configuration files for an IP phone. Other options can be a NTP server's IP address, the PBX's IP address, etc.. Whether the client receives this information depends on if it requests it.
tftp Option Gotchas
If you have a DHCP server that is giving out option 66 or 150 and attempt to "test" if it is working by sniffing the network using a PC and Wireshark, the capture will not work. A PC does not request a tftp server IP address and the DHCP server will not "automatically" send out information not requested. Most IP phones will provide status logs that you can browse to see if they are receiving the correct network information.
While most IP phones look for DHCP option 66 for the tftp server address, Cisco phones look for option 150 which allows you to list two tftp servers: the primary and secondary. Sometimes the format of the tftp option at the DCHP server can cause problems. This happens when you are running multiple brands of IP phones. For example, Cisco phones expect that option 150 will share the tftp IP address as a hexadecimal number while Aastra phones expect the IP address as ASCII characters. In this example, the Aastra phones failed to receive the tftp server IP address.
When configuring a Cisco router or switch as a DHCP server, the tftp option line would be:
option 150 ip 192.168.0.1 - for a Cisco phone option 150 ascii "192.168.0.1" - for an Aastra phoneFortunately, Aastra phones can be configured to check several different DHCP options for the tftp server.
Besides the tftp server's IP address, you can designate the IP address of the PBX and many other options that depend on the phone system that you are running. The RFC Sourcebook has an excellent detailed reference on DHCP Options.
If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.