Why This Document: There are lots of "how-to's" about setting up a tftp server on the NSLU2. However, the typical application seems to be for VoIP? phones, diskless workstations, and other devices that need to download their firmware and configs at bootup. This only requires files to be copied from the NSLU2 which is exactly what the tftpd-hpa software does out of the box. However, the application I had in mind was to copy config files and IOS images from a switch or router both to and from a tftp server and that requires extra steps. These extra steps didn't seem to be in any one place, so I wrote this document.

to:

Why This Document: There are lots of "how-to's" about setting up a tftp server on the NSLU2. However, the typical application seems to be for VoIP phones, diskless workstations, and other devices that need to download their firmware and configs at bootup. This only requires files to be copied from the NSLU2 which is exactly what the tftpd-hpa software does out of the box. However, the application I had in mind was to copy config files and IOS images from a switch or router both to and from a tftp server and that requires extra steps. These extra steps didn't seem to be in any one place, so I wrote this document.

October 25, 2007, at 11:33 AM
by Alastair Bor -- Correct spelling of my name :)

Changed lines 6-7 from:

Acknowledgement: This document owes some of it's content to Alistair Bor's web page: "Find out about building a compact home PABX" (www.ambor.com/public/home_pabx/home_pabx.html) as well as to the NSLU2 Linux web site (www.nslu2-linux.org).

to:

Acknowledgement: This document owes some of it's content to Alastair Bor's web page: "Find out about building a compact home PABX" (www.ambor.com/public/home_pabx/home_pabx.html) as well as to the NSLU2 Linux web site (www.nslu2-linux.org).

At first, the default setup only allows overwriting existing files so the -c option has to be added to server_args as shown above. The last server_args option (-s /opt/tftpboot) in the tftp file insures that all files will be deposited on the /opt/tftpboot directory so you don't have to specify where to put your files or remember which directory you put them in later. Finally, check that /opt/etc/xinetd.d/telnetd looks like this:

This will enable telnet on startup so you won't have to go through the Web GUI again.

7. We need to change permissions and ownership for /opt/tftpboot so that files can be written to it. First, copy any file into the /opt/tftpboot directory so we can see the changes work. I chose /opt/etc/xinetd.conf:

You'd probably guess that read/write permission would be adequate (chmod -R 666). Trial and error seems to show that read/write/execute permission is necessary (chmod -R 777).

8. Try to tftp a file to the NSLU2 using the built-in tftp utility on Windows XP and whatever text file happens to be in your current directory:

C:\>tftp 192.168.1.77 put Motorola_Driver_Log.txt

Whether you use Windows or Linux to do this, make sure your built-in firewall isn't blocking tftp. A network sniffer like Wireshark (formerly Ethereal) may be helpful. Timeouts indicate this sort of problem while error messages like "permission denied" or "file not found" indicate configuration problems.

Back on the NSLU2 command line, you should be able to see the file now:

# ls
Motorola_Driver_Log.txt xinetd.conf
#

9. All that's left to do is to connect an actual router and try copying a config file and IOS image to the tftp server. First, physically connect the router to the network, log on, and configure the interface:

At first, the default setup only allows overwriting existing files so the -c option has to be added to server_args as shown above. The last server_args option (-s /opt/tftpboot) in the tftp file insures that all files will be deposited on the /opt/tftpboot directory so you don't have to specify where to put your files or remember which directory you put them in later. Finally, check that /opt/etc/xinetd.d/telnetd looks like this:

This will enable telnet on startup so you won't have to go through the Web GUI again.

7. We need to change permissions and ownership for /opt/tftpboot so that files can be written to it. First, copy any file into the /opt/tftpboot directory so we can see the changes work. I chose /opt/etc/xinetd.conf:

You'd probably guess that read/write permission would be adequate (chmod -R 666). Trial and error seems to show that read/write/execute permission is necessary (chmod -R 777).

8. Try to tftp a file to the NSLU2 using the built-in tftp utility on Windows XP and whatever text file happens to be in your current directory:

C:\>tftp 192.168.1.77 put Motorola_Driver_Log.txt

Whether you use Windows or Linux to do this, make sure your built-in firewall isn't blocking tftp. A network sniffer like Wireshark (formerly Ethereal) may be helpful. Timeouts indicate this sort of problem while error messages like "permission denied" or "file not found" indicate configuration problems.

Back on the NSLU2 command line, you should be able to see the file now:

# ls
Motorola_Driver_Log.txt xinetd.conf
#

9. All that's left to do is to connect an actual router and try copying a config file and IOS image to the tftp server. First, physically connect the router to the network, log on, and configure the interface:

Acknowledgement: This document owes some of it's content to Alistair Bor's web page: "Find out about building a compact home PABX" (www.ambor.com/public/home_pabx/home_pabx.html) as well as to the NSLU2 Linux web site (www.nslu2-linux.org).

Why This Document: There are lots of "how-to's" about setting up a tftp server on the NSLU2. However, the typical application seems to be for VoIP? phones, diskless workstations, and other devices that need to download their firmware and configs at bootup. This only requires files to be copied from the NSLU2 which is exactly what the tftpd-hpa software does out of the box. However, the application I had in mind was to copy config files and IOS images from a switch or router both to and from a tftp server and that requires extra steps. These extra steps didn't seem to be in any one place, so I wrote this document.

Introduction: The Linksys NSLU2 was designed to share a USB drive over a home network. It does this by running SAMBA, a Linux program that emulates a Windows file server. The Unslung firmware is an enhancement of the standard NSLU2 firmware that lets programs run from the external USB drive and so frees the NSLU2 to be used for other things besides a Windows file server. In this case, it will be a tftp server used to store config files and IOS images.

Note: When installation is done, the USB flash drive is formatted with a Linux file system that can't be read from a Windows box. Removing the flash drive from the NSLU2 would also disable the tftp server.

The procedure:

1. Download the Unslung firmware from www.nslu2-linux.org (there are several other firmwares available - this procedure refers specifically to Unslung rather than SlugOS, OpenWRT?, etc.). Follow the instructions in the readme file included with the firmware. Use either the upslug utility on a Linux box or the Sercomm Upgrade Utility on a Windows box to flash the new firmware to the NSLU2. The Sercomm utility is a little rough around the edges. If it doesn't work the first time, try selecting different interfaces from the dropdown list. Once the firmware and USB drive are installed, go to the Web GUI (192.168.1.77 is the default IP address) and login as:

User: admin
Password: admin

Enable telnet from the Web GUI. Later, we'll configure telnet to be enabled on startup so we won't have to do it manually. The Web GUI is also an easy way to change IP addresses, etc. Another useful thing we can do while in the Web GUI is to disable UPNP which will free up a little more RAM.

At first, the default setup only allows overwriting existing files so the -c option has to be added to server_args as shown above. The last server_args option (-s /opt/tftpboot) in the tftp file insures that all files will be deposited on the /opt/tftpboot directory so you don't have to specify where to put your files or remember which directory you put them in later. Finally, check that /opt/etc/xinetd.d/telnetd looks like this:

This will enable telnet on startup so you won't have to go through the Web GUI again.

7. We need to change permissions and ownership for /opt/tftpboot so that files can be written to it. First, copy any file into the /opt/tftpboot directory so we can see the changes work. I chose /opt/etc/xinetd.conf:

You'd probably guess that read/write permission would be adequate (chmod -R 666). Trial and error seems to show that read/write/execute permission is necessary (chmod -R 777).

8. Try to tftp a file to the NSLU2 using the built-in tftp utility on Windows XP and whatever text file happens to be in your current directory:

C:\>tftp 192.168.1.77 put Motorola_Driver_Log.txt

Whether you use Windows or Linux to do this, make sure your built-in firewall isn't blocking tftp. A network sniffer like Wireshark (formerly Ethereal) may be helpful. Timeouts indicate this sort of problem while error messages like "permission denied" or "file not found" indicate configuration problems.

Back on the NSLU2 command line, you should be able to see the file now:

# ls
Motorola_Driver_Log.txt xinetd.conf
#

9. All that's left to do is to connect an actual router and try copying a config file and IOS image to the tftp server. First, physically connect the router to the network, log on, and configure the interface: