Bug 223987 - telnet does not work
telnet does not work
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: telnet (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-23 09:36 EST by Need Real Name
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-25 08:55:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Need Real Name 2007-01-23 09:36:19 EST
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 03:35:18 EST
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 04:09:12 EST
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 04:19:12 EST
Did you setup IPv6 ??
Comment 4 Need Real Name 2007-01-24 05:11:58 EST
We don't use IPv6.
Comment 5 Harald Hoyer 2007-01-24 05:29:28 EST
please do a:
$ /sbin/lsmod |grep ipv6
Comment 6 Need Real Name 2007-01-24 05:38:11 EST
$ /sbin/lsmod |grep ipv6
ipv6                  225825  18
Comment 7 Harald Hoyer 2007-01-24 05:45:04 EST
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 05:55:47 EST
(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 07:48:29 EST
ok, could you install ltrace and do an ltrace instead of an strace?
Comment 10 Need Real Name 2007-01-24 09:04:11 EST
This is weird. ltrace shows nothing, even as root.
Comment 11 Harald Hoyer 2007-01-24 10:04:34 EST
you may need to install the debuginfo rpms also
Comment 12 Need Real Name 2007-01-24 10:32:02 EST
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 11:15:37 EST
err.. are you sure, you are running /usr/bin/telnet??

what does 

$ which telnet

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

$ which telnet
/usr/kerberos/bin/telnet
Comment 15 Harald Hoyer 2007-01-24 13:20:09 EST
please attach the full output of:

$ strace -f /usr/bin/telnet ip 10001
Comment 16 Need Real Name 2007-01-24 14:29:05 EST
Created attachment 146439 [details]
strace -f /usr/bin/telnet 1.2.3.4 10001
Comment 17 Harald Hoyer 2007-01-25 04:31:02 EST
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 04:48:10 EST
Nothing happens, it eventually times out.

) = -1 ETIMEDOUT (Connection timed out)
Comment 19 Harald Hoyer 2007-01-25 07:21:39 EST
Do you see any network traffic?
# /usr/sbin/tcpdump port 10001
Comment 20 Need Real Name 2007-01-25 07:48:14 EST
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 08:19:31 EST
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 08:29:07 EST
$ nc -4 -t lowdelay 1.2.3.4 10001
should resamble the telnet connection.. 
Comment 23 Need Real Name 2007-01-25 08:40:05 EST
You're right. Any tos header gets no connection.
Comment 24 Need Real Name 2007-01-25 08:42:42 EST
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 08:55:44 EST
no, not a telnet bug :)

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