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!)
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!
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]
Did you setup IPv6 ??
We don't use IPv6.
please do a: $ /sbin/lsmod |grep ipv6
$ /sbin/lsmod |grep ipv6 ipv6 225825 18
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
(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.
ok, could you install ltrace and do an ltrace instead of an strace?
This is weird. ltrace shows nothing, even as root.
you may need to install the debuginfo rpms also
No, that doesn't work. (Does it work for you?) I can run ltrace /bin/ls without having a debug rpm installed.
err.. are you sure, you are running /usr/bin/telnet?? what does $ which telnet say??
I am running /usr/bin/telnet using the full path. $ which telnet /usr/kerberos/bin/telnet
please attach the full output of: $ strace -f /usr/bin/telnet ip 10001
Created attachment 146439 [details] strace -f /usr/bin/telnet 1.2.3.4 10001
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..
Nothing happens, it eventually times out. ) = -1 ETIMEDOUT (Connection timed out)
Do you see any network traffic? # /usr/sbin/tcpdump port 10001
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.
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
$ nc -4 -t lowdelay 1.2.3.4 10001 should resamble the telnet connection..
You're right. Any tos header gets no connection.
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..?
no, not a telnet bug :)