Problem connecting with lftp
Ben Scott
dragonhawk at gmail.com
Tue Mar 21 16:05:01 EST 2006
[replying to list, with OP's permission]
On 3/21/06, Steven W. Orr <steveo at syslang.net> wrote:
>>> I tried to connect to a site using lftp and it just hangs. I tried using
>>> plain old ftp and it works just fine.
>>
>> Can you run a packet sniffer on the FTP control channel?
>
> No idea. Can I? Seriously, what do I do?
A packet sniffer will capture the data flowing on the network, and
show what it is actually going on. You will generally need to be
"root" to run a sniffer. There are several options for sniffers.
tcpdump is the classic example. Ethereal is a newer package. I find
it has better features, and includes a GUI as tell as a command-line
(tethereal). If your distribution doesn't already have it, you can
get it from http://www.ethereal.com/ .
To capture FTP control traffic, one would do something like this:
tethereal -i eth0 -f 'port 21'
The "-i eth0" specifies the network interface; change as needed. The
"-f" switch specifies a filter; without it, you will see all network
traffic. The "port 21" part shows us just traffic which is going to
or coming from TCP or UDP port 21.
FTP uses two TCP connections, usually called the "control channel"
and "data channel". The control channel is where FTP protocol
commands occur; a data channel is opened to actual transfer files.
The control channel uses TCP port 21, so this lets us easily (?) see
what is going on.
There are some additional switches which may be needed here. Add
"-V" to the tethereal command above to see a verbose breakdown of all
components of each network packet. Add "-x" to see a hexadecimal dump
of the full contents of every packet.
If you need help interpreting the output from tethereal, you can
redirect the output to a file and post it to the list or a website for
others to review. For example:
tethereal -i eth0 -f 'port 21' -V > capture.txt
Hope this helps,
-- Ben
More information about the gnhlug-discuss
mailing list