Installing TFTP on the Raspberry Pi

I needed a TFTP server to update the firmware on my recently purchased Cisco 7912 IP phone, and rather than disturb my existing Thin Client TFTP server setup I used the Raspberry Pi (RPi).

Thankfully I found a helpful article detailing how to install and configure a TFTP server on the RPi [ronnutter.com].

Installation

sudo apt-get install tftpd-hpa

Configuration

Edit the file sudo vim /etc/default/tftpd-hpa

Here is a sample config of what you should see when opening the file:

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-secure"

Apparently, tftpd-hpa was written to look for ipv6 and wont start if it doesnt see it running. If you look at /var/log/syslog, you will see a "bad descriptor" error message. This doesnt really tell you where the problem is. The way around this is to hard code the config file to only look for ipv4.

Add -4 or -ipv4 between the quotes on the TFTP_OPTIONS line in the file.

Then sudo service tftpd-hpa restart

After that copy the files to be visible from the TFP server into /srv/tftp and it should work fine.

Tags:
Source:
1917hrs.txt
Published:
18-04-2013 19:17