1826639 Members
3227 Online
109695 Solutions
New Discussion

Re: FTP Problems

 
Bob Hoyle
Advisor

FTP Problems

Hi,

I'm trying to do FTP transfers from a network "device" to an HP-UX computer. I have no problems tranfering from other PC's on the network. I cannot transfer from this device. The device is fairly dumb in that I can't trouble shoot too mcu at its end. It only tells me that the transfer is not working. The device only allows me to set up the following:

Remote IP (HP-UX workstation)
Gateway IP (network switch)
Netmask
user name
password

I have turned on logging on the HP-UX computer using inetd -l. I can see the PC FTP transfers but nothing from the "device".

Are there any other things I can do, at a very basic level to figure out what is happening. It is a stand-alone network so I can do pretty much anything I want at this point. Any other issues, such as time out problems, etc? Thanks in advance.

-- Bob
10 REPLIES 10
Graham Cameron_1
Honored Contributor

Re: FTP Problems

Well, it can't be the HP end, as you can FTP from other devices.
Without knowing more about your "black box", the only suggestion I have is to check it is actually listening on the ftp control port (21).

For example, from your unix box, if you telnet back to yourseld on port 21, using "telnet 0 21", you'll see something like:

Connected to 0.
Escape character is '^]'.
220 sedling FTP server (Version 1.1.214.4(PHNE_23950) Tue May 22 05:49:01 GMT 2001) ready.

This tells you there is an FTP server listening. Type QUIT to close the connection.

If you then "telnet blackbox 21" you should see something similar. If you don't it is not running an ftp service.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Bob Hoyle
Advisor

Re: FTP Problems

Graham,

Thanks for your reply. I don't think this thing will accept telnet connections and I can't FTP files back to it. I'm kind of stuck there.

Maybe I can hook the 2 boxes up directly, bypassing the network switch? To do this, I guess I would need a cross-over cable. Not sure what I would specify as the gateway address on the device in such a case. Probably the IP address of the HP-UX Workstation instead of the switch.

I'm beginning to suspect the network adapter on the device. I'm at my customer's site. I think I'll have to bring it back home and trouble shoot things back there, get some support from the manufacturer. I'm trying to get support from them but they're 6 hours behind me.

-- Bob
Graham Cameron_1
Honored Contributor

Re: FTP Problems

Bob

If you "telnet box 21" it won't think it is a telnet connection.
It will think it is an FTP connection.
Please try it.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Bob Hoyle
Advisor

Re: FTP Problems

Graham,

When I execute "ftp box 21", it just hangs and then times out. Would there not have to be an FTP server running on the device? I don't think it is meant to accept files, only send them.

-- Bob
Graham Cameron_1
Honored Contributor

Re: FTP Problems

Bob

"ftp box 21" will always time out.
Try "telnet box 21".
And yes, if the box is to take part in any FTP conversation, be it get, put, or even just ls, it must be listening on FTP port 21.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Mark Greene_1
Honored Contributor

Re: FTP Problems

What's the device? If it is something like teriminal server, it will be looking for tftp, not ftp. See the man pages for tftp and tftpd for more info. You basically have to uncomment the tftp line in /etc/inetd.conf, hup the inetd process, and make sure that there is a "tftp" user created with a home directory of /tftpdir. Also, make sure your network is not blocking port 69 internally.

mark
the future will be a lot like now, only later
Mark Grant
Honored Contributor

Re: FTP Problems

Actually, the client doesn't need to listen on port 21. Try disabling ftp services and telnet hostname 21 you will get connection refused but you can still ftp out.
Never preceed any demonstration with anything more predictive than "watch this"
Ron Kinner
Honored Contributor

Re: FTP Problems

How does this beast get its own IP address? Does it respond to pings? Have you tried putting a laptop or other PC in its place with the same info? I'm a little concerned that you said the Gateway was set to the Switch IP. Is this a layer three switch? Are the two devices on the same subnet? Any firewalls?

If you want to connect the device directly to the HPUX with a crossover: Give it an IP on the same subnet as the HPUX, use the same mask as the HPUX. The gateway doesn't matter since none is required for a local connection but if it insists you can put in the IP address of the HPUX.

You can install tcpdump on the hpux and see exactly what is happening but I expect since you see no failed attempts that it is not able to contact the HPUX. In that case put a hub in between the switch and the device and plug in a sniffer. (www.snort.org is a good place to get a free sniffer program. I use it on an NT box and it is great. It's actually an intrusion detector but in its simplest mode it does a good job as a sniffer and it is easy to filter the output so you can only see tcp traffic from the device.)




By the way guys, an FTP client doesn't have to listen on any particular port. The server does (21) but the client will send from whatever port it feels like (x) to port 21 to set up the control link. The data link is normally made from port 20 on the server back to the port the client used for the Control link plus 1 (x+1). This is why firewalls have such a hard time with FTP. The data link is an incoming link to a random port as far as the firewall is concerned and thus suspicious so it wants to block it. In order to get around this, FTP can use the passive mode where the data link is established in the opposite direction.

See:

http://slacksite.com/other/ftp.html

Note that "ports > 1024" in the article means a random port larger than 1024. This refers to the port range usually used for an outgoing connection. In the old days it used to start at 1025 then the next connection would be made from 1026 and so on but the hackers used this known sequence to spoof the connection so now it choses a random number from some minimum (still greater than 1024) to some max which is limited to somewhere around 65K. You can set both limits in ndd.

Ron
Bill Hassell
Honored Contributor

Re: FTP Problems

This is definitely a non-standard ftp device. When you test it with a PC, wre you using the 'real' ftp from a DOS window or some sort of ftp lookalike? The fact that telnet blackbox 21 does not work indicates that it is not accepting standard ftp connections. I would suspect that the same failure will occur on the PC using telnet from a DOS window. Using a DOS window will bypass any utilities that don't behave normally (perhaps your PC's ftp has multiple protocols under the skin?)


Bill Hassell, sysadmin
Bob Hoyle
Advisor

Re: FTP Problems

Thanks to all,

I was not able to resolve the problem at the customer's site. I have the device back home here and will be able to test it in a couple of weeks. Hopefully it is the device otherwise there may be some problems through the switch. Will do some research on the switch, the device and HP-UX or PC tools to figure things out. Will have to resolve this issue on our next support visit in January or February. Thanks again for every ones help.

-- Bob