LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   using tftp - can't get image, but can ping both ways (https://www.linuxquestions.org/questions/linux-networking-3/using-tftp-cant-get-image-but-can-ping-both-ways-874550/)

adetheheat 04-12-2011 07:32 AM

using tftp - can't get image, but can ping both ways
 
I have created a /tftpboot directory and chmod it to 777.
I have put an image 'uImage' on my Debian box under /tftpboot

In directory /etc/xinetd.d/ I have created file tftp:

Service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = /tftpboot
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on _success = HOST
}

I restart tftp server with:

/etc/init.d/xinetd restart


Now I can ping the debian box from my pc and vice versa.
Now when I try to do an ftp:

tftp 192.168.2.211 GET uImage

I keep geting timeouts although uImage is on the debian box and it appears the tftp server is running.

sag47 04-12-2011 09:18 AM

Is the firewall blocking it?

Try on the server.
Code:

tftp 127.0.0.1 GET uImage
If that works then it is likely a firewall issue.

adetheheat 04-12-2011 10:06 AM

Quote:

Originally Posted by sag47 (Post 4322187)
Is the firewall blocking it?

Try on the server.
Code:

tftp 127.0.0.1 GET uImage
If that works then it is likely a firewall issue.

Started tftp. Typed connect 127.0.0.1 - seemed to connect ok.
The get uImage call got Transfer Timed out response.

michaelk 04-12-2011 12:01 PM

Is the tftp server actually installed? The connect command does not actually create a connection.
What distribution are you running?

adetheheat 04-12-2011 12:07 PM

Quote:

Originally Posted by michaelk (Post 4322330)
Is the tftp server actually installed? The connect command does not actually create a connection.
What distribution are you running?

I'n running Debian.I think tftp is installed as I can start it with

>tftp
from the tftp prompt connect successfully and then the get fails with timeout.

cheers

michaelk 04-12-2011 12:34 PM

Does /usr/sbin/in.tftpd exist?
tftp is the client, in.tftpd is the server. The connect command only saves the hostname it does not actually create a connection.

In a nutshell when xinetd detects a packet on port 69 it will launch the server tftpd. The client is not detecting anything from the server and so times out.

adetheheat 04-13-2011 05:28 AM

ok, thanks MichaelK,
getting further now.
the file in.tftpd now exists.

Now on the linux box I can do 'tftp'.
I can connect to 127.0.0.1
I do the get uImage. It waits for a while before coming back with a 'Transfer Timed out' message.
uImage is definitley there in /tftpboot. I also get the same error if I try and do a non existent file.

If I go to a dos prompt on another pc and do an ftp then connect to the linux box I get weird errors about:

Can't exec "/usr/sbin/pure-ftpd": No such file or directory at /usr/sbin/pure-ft
pd-wrapper line 174.
/usr/sbin/pure-ftpd-wrapper: Cannot exec /usr/sbin/pure-ftpd: No such file or di
rectory at /usr/sbin/pure-ftpd-wrapper line 174.
Connection closed by remote host.


Not sure these are relevant but it does mean maybe that I will have issues doing an ftp

michaelk 04-13-2011 06:04 AM

Change the server_args to the following
Quote:

server_args = -s /tftpboot

adetheheat 04-13-2011 06:20 AM

Same problem. What I'm doing is
1. #tftp
2. >connect 127.0.0.1
3. >get uImage

adetheheat 04-14-2011 04:08 AM

anyone ? ftp not working on my pc

michaelk 04-14-2011 07:30 AM

Lets get tftp working and then we can worry about ftp.
What are the permissions of /tftpboot and uImage?

adetheheat 04-14-2011 07:40 AM

firsly thanks for your help Michael,
permissions on /tftboot 777 and uImage is 644 ie it has read access for everyone.
Aside: I was unaware that ftp and tftp were different tools. I'm using tftp as you know.

michaelk 04-14-2011 07:58 AM

Try turning on trace and verbose to help. These are tftp commands.
So
1. #tftp
2. >connect 127.0.0.1
3. >trace
4. >verbose
5. >get uImage
Post any debug infomation.

adetheheat 04-14-2011 08:15 AM

getting from 127.0.0.1:uimage to uimage
sent RRQ <file=uimage, mode=netascii>
sent RRQ <file=uimage, mode=netascii>
sent RRQ <file=uimage, mode=netascii>
sent RRQ <file=uimage, mode=netascii>
Transfer timed out

michaelk 04-14-2011 07:31 PM

The client is not getting a response from the server. Make sure that xinetd is running. Is there any thing in the /etc/hosts.deny file?


All times are GMT -5. The time now is 10:00 PM.