Saturday, July 16, 2011

Installing a TFTP Server on Ubuntu 11.04

TFTP has a variety of uses in the networking world due to its simplicity and ease of use. This guide serves as an accompaniment to my guide to updating Cisco IOS on a wireless access point. Just note there are a multitude of ways to set up a TFTP server on linux, I just found this way to be the easiest.

Guide originally posted here: TuxCoder

I preformed this install on a server running Ubuntu 11.04. All commands should be executed by the root user or by using sudo.

First, install the needed TFTP packages.

sudo apt-get update && sudo apt-get install tftp-hpa tftpd-hpa

The default location for for TFTP files is /var/lib/tftpboot. You can set a different location later if you'd like, but you must chmod and chown the directory you choose.

sudo mkdir /var/lib/tftpboot
sudo chown nobody.nogroup /var/lib/tftpboot
sudo chmod 777 /var/lib/tftpboot

Edit the TFTP server configuration file to put the service in daemon mode and set a custom directory you may have chosen above.

sudo nano /etc/default/tftpd-hpa

Edit the file to your liking.

#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"

Start the TFTP server.

sudo /etc/init.d/tftpd-hpa start

To ensure the service started, run this command:

netstat -a |grep tftp

The Output should look something like this:

$ netstat -a | grep tftp
udp 0 0 *:tftp *:*
Copy any files you need to share over TFTP to /var/lib/tftpboot or the directory you chose and you're good to go!

6 comments:

  1. nice information but could you tell me how to copy IOS of a router and send IOS file to router

    thanks in advance

    ReplyDelete
  2. https://qcktech.blogspot.com/2011/08/installing-tftp-server-on-windows.html?showComment=1567149509039#c2158430394999600204

    ReplyDelete