Trivial File Transfer Protocol (TFTP) Servers on the PBX

Trivial File Tranfer Protocol (TFTP) servers are used to transfer files to and from devices. The files can be configuration files for a router or a switch, or it can be configuration files to tell an IP phone who to and how to register to a PBX. The configuration files can even be new firmware for a device!

VoIP and TFTP Servers

TFTP operates on UDP port 69. It is a simple protocol that can only read and write files. It can't display directories or move files. It is used for automatic configuration of network devices when they boot up. This makes it very desirable for large networks with many devices. Rather than go to each device and manually configure it, you can keep the configuration on a TFTP server and the device can download its configuration upon boot-up. TFTP works hand in hand with the DHCP protocol.

TFTP and IP Phones

When an IP phone boots up, it looks for a DHCP server for its IP address and network configuration. DHCP can also pass the IP address of the TFTP server through one of the DHCP options: usually option 66 or 150. When the phone receives the TFTP address, it goes to the TFTP server and looks for configuration files and firmware based on its model and MAC address. When it finds the files, it downloads the files and using the information inside, registers to the PBX.

You can have common global configuration files and firmware for a phone such as an Aastra model and specific configuration for each phone extension based on their MAC address. Endpoint configuration manager software allows you to change the configuration or firmware for all of the phones at one time! With the push of one global phone reset button, you can update all of your phones to the latest firmware or feature at once. It is a great time saver!

Typically TFTP boot directory on TFTP server

The above image shows a typical TFTP boot directory on a TFTP server running PBX in a Flash. The files ending with ".st" are firmware files for different models of Aastra phones. The "aastra.cfg" file is a global configuration file that contains instructions for features such as call forward, call waiting, BLF, etc.. and is downloaded by all Aastra phones. The files that have MAC addresses and ending in ".cfg" such as "0085D28A10F.cfg" is a specific phone's registration information: extension number, secret, registrar, caller ID, etc..

Aastra 0085D28A10F.cfg configuration file

When looking at the Aastra 0085D28A10F.cfg configuration file, we can easily read it as it is a text file. It tells the phone, its extension number (1011), secret (password: 1234ab), IP address and port to use for the registrar and the proxy if they are different machines. Also feature codes can be configured such as how to access the voicemail: *97 in this example.

Referring back to the TFTP boot directory, the files starting with "POS3-8-12-00" and "P003-8-12-00" are firmware files for Cisco IP phones. OS79XX.TXT is used to tell the Cisco phones which version of firmware to download. Not shown in the image would be files starting with SEP<mac address>.xml or SIP<mac address>.xml that point to the specific IP phones for their registration information.

Location of TFTP Servers

A TFTP server can located on a router, switch, PC or a server. Ideally it should be on a network device that is always up and running with a static IP address. In the previous examples, it is located on the PBX and TFTP is configured to look in the /tftpboot directory for files. The rule is NO subdirectories in the TFTP directory which can make quite a messy directory!

Testing a TFTP server

How do you know that your TFTP server is working properly? You can test the TFTP server from the Windows command line by first putting a test.txt file in the TFTP boot directory and then typing the following commands:

c:\temp> tftp -i 192.168.2.254 GET test.txt

The file should download from the TFTP server at address 192.168.2.254 to the Windows c:\temp directory in this example.

Windows Quirk Alert! You cannot run the above command from the Windows root directory C:\, you will receive an error message stating that you don't have permission!

Most phones provide a logging function that you can scan through to see what the phone is expecting to download and then compare to what is on the server. Often, a file will have a "case" problem - TFTP files are case sensitive. I've run into a problem with Cisco phones where one model expected the file to all capital letters and the other model of Cisco phone expected just the first letter to be capital. I made two copies of the file, one for each model of the phone.

On the server, there is logging that tracks the requests to the TFTP server, this is handy to look through if you have a problem. You can also sniff the network usng Wireshark to see if the TFTP traffic is getting to and from the server. Lastly, in the Linux world, you can run tcpdump to view the communication that is going out the Ethernet port.

If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.

Return to

TelecomWorld 101

Copyright July 2013 Eugene Blanchard