OpenWrt Forum Archive

Topic: [How to] Setting up a TFTP server

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Setting up a TFTP server (OpenWrt WhiteRussian RC6)


1. edit /etc/ipkg.conf and include the RC6 backports repository if not already done

src backports http://downloads.openwrt.org/backports/rc6

2. install the atftpd package (the dependency bug is already reported, ticket #1022) -- atftpd and all dependencies require about 150k space on the flash

ipkg update
ipkg install atftpd libpthread

3. create a directory and a test file for your TFTP server

mkdir /atftpboot
echo "TFTP test" > /atftpboot/test.txt

4. start the TFTP server with

atftpd --daemon --port 69 /atftpboot

4.1. check if the TFTP server process is running and listening on port 69/UDP

ps ax | grep atftpd
548 nobody      412 S   atftpd --daemon --port 69 /atftpboot

netstat -an | grep "0:69"
udp        0      0 0.0.0.0:69              0.0.0.0:*

Everything is ok.

5. Test the server with a TFTP client
We test the TFTP server by receiving the test.txt file we created in step 3.

5.1. Windows TFTP client (Start -> Run -> CMD)

C:\>tftp <ip_of_router> GET test.txt
Transfer successful: 11 bytes in 1 second, 11 bytes/s

5.2. Linux atftp client

atftp --get --remote-file test.txt <ip_of_router>

6. create a simple start script /etc/init.d/S50atftpd and make it executable

#!/bin/sh
atftpd --daemon --port 69 /atftpboot
chmod +x /etc/init.d/S50atftpd

Add this to the OpenWrt wiki if you like.

(Last edited by forum2006 on 7 Dec 2006, 15:12)

If I start tftp I will can upgrade my firmware via tftp ?

The discussion might have continued from here.