LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   TFTP Server: cannot get atftpd to work over the LAN (https://www.linuxquestions.org/questions/linux-newbie-8/tftp-server-cannot-get-atftpd-to-work-over-the-lan-4175482345/)

vasis 10-27-2013 09:12 AM

TFTP Server: cannot get atftpd to work over the LAN
 
Hello All,

I run Debian 7.1 (wheezy) on my server and I am trying to set up a TFTP server in order to transfer some config files from a Cisco device I'm playing with recently.

I have installed atftpd as my TFTP server software and I changed the config file (/etc/default/atftpd) to look like this:

Code:

USE_INETD=false
OPTIONS="--tftpd-timeout 300 --no-blksize --retry-timeout 5 --mcast-port 1758 --bind-address 192.168.0.100 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /media/md1_storage/tftp"

I created the above directory with the following permissions:

Code:

...md1_storage$ ls -la
drwxrwxrwx  3 nobody  nogroup  4096 Oct 27 13:13 tftp

In order to test my TFTP server I also installed atftp as my client and I tested it with both 'put' and 'get' and I transfered/received the test files as expected. The logs were clean with no errors and the files in the correct TFTP directory with their contents. And that was locally.

However, transfer over the LAN gets a bit weird... I installed atftp on my laptop which runs Ubuntu 12.04 in order to give it a go before doing it from the Cisco device. Here is the result:

Client (laptop):

Code:

tftp> status
Connected:  192.168.0.100 port 69
Mode:      octet
Verbose:    on
Trace:      on
Options
 tsize:    enabled
 blksize:  enabled
 timeout:  enabled
 multicast: enabled
mtftp variables
 client-port:  76
 mcast-ip:      0.0.0.0
 listen-delay:  2
 timeout-delay: 2
Last command: trace
tftp> put test.pl
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
timeout: retrying...
tftp: aborting
tftp>

Server Logs:

Code:

Oct 27 13:13:11 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:13:15 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:13:20 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:13:25 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:13:30 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:13:35 helios atftpd[2146]: Fetching from 192.168.0.249 to test.pl

The TFTP directory on the server looks like this:

Code:

ls -la /media/md1_storage/tftp/
drwxrwxrwx  3 nobody nogroup  4096 Oct 27 13:51 .
drwxr-xr-x 11 root  root      4096 Oct 25 13:53 ..
-rw-r--r--  1 nobody nogroup      0 Oct 27 13:51 test.pl

I can see the file, but it's empty!

Moving on, I thought that I could get this thing working by disabling ufw on my Ubuntu client. Now this is what I get:

Client:

Code:

tftp> put test.pl
sent WRQ <file: test.pl, mode: octet <timeout: 300, blksize: disabled>>
tftp: error received from server <Failure to negotiate RFC1782 options>
tftp: aborting
tftp> mode netascii
tftp> put test.pl
sent WRQ <file: test.pl, mode: netascii <timeout: 300, blksize: disabled>>
tftp: error received from server <Failure to negotiate RFC1782 options>
tftp: aborting
tftp>

Server Logs:

Code:

Oct 27 13:57:47 helios atftpd[6602]: Fetching from 192.168.0.249 to test.pl
Oct 27 13:58:04 helios atftpd[6602]: Fetching from 192.168.0.249 to test.pl

The only difference I can see is that there are no retries (two line in the log, one for each attempt)...

I checked the RFC but I do not see how could I change the options on the client. The 'option' argument of the atftp client sets set RFC1350 options, not RFC1782 options, which is what the error indicates.

Can anyone see what is that I have missed? Thank you in advance!

schneidz 10-27-2013 03:18 PM

Does the client machine support scp (with keys) ?

vasis 10-28-2013 05:08 PM

Hello,

Thanks for your reply.

Yes ofc it supports scp, rsync and all the rest... I also have SFTP working on the same server without any issues! However, the ultimate goal is to transfer files between the server and the Cisco device. So TFTP is my only option.

Any ideas? Thank you in advance!

vasis 03-02-2014 09:29 AM

I got back to this after a while. I think I fixed the issue and I thought I should post it here in case someone else has similar problems...

The client assumes a block size but in the server config I had "--no-blksize". After reading the post again, I found the client logs a bit suspicious where it says "blksize: enable":

Code:

...
tftp> put test.pl
sent WRQ <file: test.pl, mode: octet <tsize: 237, timeout: enable, blksize: enable, multicast: enable>>
...

I can see the test.pl file with its contents now. I might post back when I substitute the Ubuntu client with the Cisco PIX, if there is any problem. Solved for now!


All times are GMT -5. The time now is 04:26 AM.