Bug 223987 - telnet does not work
Summary: telnet does not work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: telnet
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-23 14:36 UTC by Need Real Name
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-25 13:55:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
strace -f /usr/bin/telnet 1.2.3.4 10001 (4.19 KB, text/plain)
2007-01-24 19:29 UTC, Need Real Name
no flags Details

Description Need Real Name 2007-01-23 14:36:19 UTC
I have a very odd problem.
Telnet doesn't work from Linux, but it does from everything else I can find.

On Linux, this does not work:
 telnet 1.2.3.4 10001
The connection times out.

For troubleshooting, I tried the same under FreeBSD and Windows.

FreeBSD, Windows: ping, traceroute, telnet all work.

Linux:
 telnet: fails
 ping: works
 traceroute: fails (well, I get a page of 30 rows of asterisks)
 traceroute -I: works
 mtr: works

There is no difference between the machines for routing purposes, and no
firewall is in the way.

I even confirmed this with
 nmap 1.2.3.4 -p 10001 -sT
from the Fedora box.

To check further, I installed FreeBSD in a VM under FC5. That worked too.

Perhaps this is this a problem with a high telnet port number?
(or perhaps not!)

Comment 1 Need Real Name 2007-01-24 08:35:18 UTC
The problem is definitely telnet.

$ nc -tv -w 5 1.2.3.4 10001
Connection to 1.2.3.4 10001 port [tcp/scp-config] succeeded!

Comment 2 Need Real Name 2007-01-24 09:09:12 UTC
As a test, I ran
 nc -l 10001
and ran strace telnet ip 10001
I compared the output to
 strace telnet ip 10001
on the remote host.

The relevant part for it working:
open("/etc/hosts", O_RDONLY)            = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=212, ...}) = 0
read(3, "# Do not remove the following line, or various [snip]", 4096) = 212
close(3)                                = 0
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_IP, IP_TOS, [16], 4)  = 0
connect(3, {sa_family=AF_INET, sin_port=htons(10001),
sin_addr=inet_addr("1.2.3.4")}, 16) = 0
open("/home/user/.telnetrc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
write(1, "Trying 1.2.3.4...\r\nConnected

The relevant part for it not working:

open("/etc/hosts", O_RDONLY)            = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=212, ...}) = 0
read(3, "# Do not remove the following line, or various [snip]", 4096) = 212
read(3, "", 4096)                       = 0
close(3)                                = 0
[hangs here]

Comment 3 Harald Hoyer 2007-01-24 09:19:12 UTC
Did you setup IPv6 ??

Comment 4 Need Real Name 2007-01-24 10:11:58 UTC
We don't use IPv6.

Comment 5 Harald Hoyer 2007-01-24 10:29:28 UTC
please do a:
$ /sbin/lsmod |grep ipv6


Comment 6 Need Real Name 2007-01-24 10:38:11 UTC
$ /sbin/lsmod |grep ipv6
ipv6                  225825  18


Comment 7 Harald Hoyer 2007-01-24 10:45:04 UTC
ok, you may consider adding to /etc/modprobe.conf:
install ipv6 /bin/true

and please test:
http://people.redhat.com/harald/downloads/telnet/telnet-0.17.35.3.fc5

Comment 8 Need Real Name 2007-01-24 10:55:47 UTC
(In reply to comment #7)
> ok, you may consider adding to /etc/modprobe.conf:
> install ipv6 /bin/true

Done, this didn't work.

> and please test:
> http://people.redhat.com/harald/downloads/telnet/telnet-0.17.35.3.fc5

Also done. This didn't work.

All combinations of the above don't work either.

Comment 9 Harald Hoyer 2007-01-24 12:48:29 UTC
ok, could you install ltrace and do an ltrace instead of an strace?

Comment 10 Need Real Name 2007-01-24 14:04:11 UTC
This is weird. ltrace shows nothing, even as root.

Comment 11 Harald Hoyer 2007-01-24 15:04:34 UTC
you may need to install the debuginfo rpms also

Comment 12 Need Real Name 2007-01-24 15:32:02 UTC
No, that doesn't work. (Does it work for you?)

I can run ltrace /bin/ls without having a debug rpm installed.

Comment 13 Harald Hoyer 2007-01-24 16:15:37 UTC
err.. are you sure, you are running /usr/bin/telnet??

what does 

$ which telnet

say??

Comment 14 Need Real Name 2007-01-24 17:33:39 UTC
I am running /usr/bin/telnet using the full path.

$ which telnet
/usr/kerberos/bin/telnet

Comment 15 Harald Hoyer 2007-01-24 18:20:09 UTC
please attach the full output of:

$ strace -f /usr/bin/telnet ip 10001

Comment 16 Need Real Name 2007-01-24 19:29:05 UTC
Created attachment 146439 [details]
strace -f /usr/bin/telnet 1.2.3.4 10001

Comment 17 Harald Hoyer 2007-01-25 09:31:02 UTC
connect(3, {sa_family=AF_INET, sin_port=htons(10001),
sin_addr=inet_addr("1.2.3.4")}, 16...

looks good, but nothing seems to happen.. 

Comment 18 Need Real Name 2007-01-25 09:48:10 UTC
Nothing happens, it eventually times out.

) = -1 ETIMEDOUT (Connection timed out)

Comment 19 Harald Hoyer 2007-01-25 12:21:39 UTC
Do you see any network traffic?
# /usr/sbin/tcpdump port 10001


Comment 20 Need Real Name 2007-01-25 12:48:14 UTC
Yes:

# /usr/sbin/tcpdump -n port 10001
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
13:45:33.545900 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23272262 0,nop,wscale 2>
13:45:36.543451 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23273012 0,nop,wscale 2>
13:45:42.543330 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23274512 0,nop,wscale 2>
13:45:54.543084 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23277512 0,nop,wscale 2>
13:46:17.217622 IP 1.2.3.4.scp-config > 10.1.1.1.46258: R 0:0(0) win 1400 <ccnew
235868177[len 13],[bad opt]>
13:46:18.542606 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23283512 0,nop,wscale 2>
13:46:18.543217 IP 1.2.3.4.scp-config > 10.1.1.1.46259: S 909522486:909522486(0)
ack 13509209 win 1400 <mss 1460,sackOK,timestamp 23283512 0,nop,wscale 2>
13:47:06.541619 IP 10.1.1.1.46259 > 1.2.3.4.scp-config: S 13509208:13509208(0)
win 5840 <mss 1460,sackOK,timestamp 23295512 0,nop,wscale 2>
13:47:06.542228 IP 1.2.3.4.scp-config > 10.1.1.1.46259: . ack 1 win 1400 <mss
1460,sackOK,timestamp 23295512 0,nop,wscale 2>
13:47:18.544166 IP 1.2.3.4.scp-config > 10.1.1.1.46259: R 0:0(0) win 1400 <mss
1460,sackOK,timestamp 23295512 0,nop,wscale 2>

where 10.1.1.1 is myip and 1.2.3.4 is the destination.

Comment 21 Harald Hoyer 2007-01-25 13:19:31 UTC
seems like s.th. odd is going on, on your network... is there a filter/firewall
in between?
The only difference to "nc", I can think of is Type Of Service:
setsockopt(3, SOL_IP, IP_TOS, [16], 4)  = 0



Comment 22 Harald Hoyer 2007-01-25 13:29:07 UTC
$ nc -4 -t lowdelay 1.2.3.4 10001
should resamble the telnet connection.. 

Comment 23 Need Real Name 2007-01-25 13:40:05 UTC
You're right. Any tos header gets no connection.

Comment 24 Need Real Name 2007-01-25 13:42:42 UTC
You're excellent!

Using telnet -S "" ip port works :)

Now to hassle the vendor so they fix their kit.
I suppose this isn't a telnet bug then..?

Comment 25 Harald Hoyer 2007-01-25 13:55:44 UTC
no, not a telnet bug :)


Note You need to log in before you can comment on or make changes to this bug.