05 April 2012

Make tftpd-hpa play nicely with Cisco

The following was tested on Ubuntu 11.10. This is completely insecure, make sure it is confined to a LAN environment, i.e. not publicly accessibly. 

apt-get install tftpd-hpa

mkdir /tftp
chmod 777 /tftp

nano /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --create -v"
service tftpd-hpa restart 

--create is needed to allow client to create new file. Otherwise you will get error stating 'File does not exist' or similar.


--secure is so that the client does not need to specify an absolute path such as /tftp/file. The root of the tftp server becomes TFTP_DIRECTORY.


-v is for verbose logging in /var/syslog





culv-lns1#copy run tftp
Address or name of remote host []? 10.2.2.40
Destination filename [culv-lns1-confg]?
!!
1446 bytes copied in 0.168 secs (8607 bytes/sec)
_________________________________________________



culv-lns1#copy tftp://10.2.2.40/test.0 flash
Destination filename [test.0]?
Accessing tftp:// 10.2.2.40 /test.0...
Loading test.0 from  10.2.2.40  (via GigabitEthernet0/0): !
[OK - 816 bytes]


816 bytes copied in 0.408 secs (2000 bytes/sec)






















1 comment:

  1. Very nice post. Thank you for sharing. I was getting sick of having to run tftp32 on windows when it came time to back or upgrade network equipment.

    ReplyDelete