LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Having issues with tftp (http://www.linuxquestions.org/questions/linux-software-2/having-issues-with-tftp-4175430311/)

wcrandthor 10-03-2012 11:58 AM

Having issues with tftp
 
I'm trying to get TFTP working on my OpenSUSE virtualbox running on a Windows 7 machine, sending a file from OpenSUSE to a board running uCLinux...

On OpenSUSE (12.1) I have tftp-hpa 5.1, seems pretty straight forward, but for some reason my files are timing out.

On the uCLinux side, I didn't do anything, I just verified that tftp was present:

Code:

# tftp --help
BusyBox v0.60.5 (2012.07.09-14:05+0000) multi-call binary

Usage: tftp [OPTION]... HOST [PORT]

And that was pretty much it. (Do I need to set it up to receive?)

Then on my OpenSUSE side I started with a ping of my remote board:
Code:

mike@linux-4puc:~/iCOM/framework/cm> ping 192.168.254.1
PING 192.168.254.1 (192.168.254.1) 56(84) bytes of data.
64 bytes from 192.168.254.1: icmp_seq=1 ttl=255 time=45.6 ms
64 bytes from 192.168.254.1: icmp_seq=2 ttl=255 time=1.09 ms
64 bytes from 192.168.254.1: icmp_seq=3 ttl=255 time=2.19 ms

Good, we can see it, then I tried to set up for a ASCII transfer:
Code:

mike@linux-4puc:~/iCOM/framework/cm> tftp
tftp> connect 192.168.254.1
tftp> ascii
tftp> status
Connected to 192.168.254.1.
Mode: netascii Verbose: off Tracing: off Literal: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> put cm.c
Transfer timed out.

So it looks like I connected successfully, and got it setup correct, but then it times out. Any ideas why? Did I do something wrong?

michaelk 10-03-2012 12:29 PM

What you were verifying on the uClinux side was the client not the server.

Typically the server runs from xinetd and I assume there is a /etc/xinetd.d/tftp configuration file which should be similar to the following. Not sure how works on your board.

Code:

service tftp
{
        socket_type            = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args            = -c -s /tftpboot -l
        disable                = no
}

By default, tftpd will only allow uploading of files that already exist but there could be other reasons why the transfer is failing.

http://linux.die.net/man/8/in.tftpd

wcrandthor 10-03-2012 12:59 PM

Quote:

What you were verifying on the uClinux side was the client not the server
Yes... but that's what I want right? I'm trying to send a file OpenSUSE->uCLinux
so I need the server running on OpenSUSE and I just need to make sure that the uCLinux has a TFTP client.

On my OpenSUSE setup I did verify that the tftp file was present:
Code:

mike@linux-4puc:~> cat /etc/xinetd.d/tftp
service tftp
{
        socket_type                = dgram
        protocol                = udp
        wait                        = yes
        user                        = root
        server                        = /usr/sbin/in.tftpd
        server_args                = -s /srv/tftpboot
        disable                        = no
}

So I think that should be fine.

Quote:

tftpd will only allow uploading of files that already exist
I was not aware of that fact. Is there a way to change that? And where on the target/client do the files end up going?

michaelk 10-03-2012 01:19 PM

My fault for not paying attention.

Just a matter of semantics but what you really want to do is download a file from the server to your board. The file should be in the /srv/tftpboot directory on the SuSE box and make sure xinetd is running.

From the tftp client on the board you want to use get and not put.

Also make sure the file permission are set correctly.

jefro 10-03-2012 02:44 PM

I tend to do it the other way as in get from a source.

In some cases and I am not sure about this but a file must exist on the remote before a transfer can happen from a put command.

As above you have to be on a file system location that your user has write permissions to for put.


Test it the other way around and telnet to the box and do a get.

Try also the ls command.

Some busybox implementations or embedded versions are also an issue.

Long way around is maybe tftp-32 on windows and drag and drop to OpenSuse if guest additions are enabled.


All times are GMT -5. The time now is 03:23 PM.