Operating System - HP-UX
1819682 Members
3997 Online
109605 Solutions
New Discussion юеВ

Telnet is taking long time to connect

 
Gamaliel
Frequent Advisor

Telnet is taking long time to connect

Hi there,

When i issue telnet hostname it could take more than 3 mins. to prompt for the login and password.

My server is a RP3440, with UX 11.11, PHNE_30695

Ping to the server by hostname and ip_addr works fine, also ssh connections.

Any help?
19 REPLIES 19
James R. Ferguson
Acclaimed Contributor

Re: Telnet is taking long time to connect

Hi:

This sounds like a DNS reverse-name lookup delay. Try adding your PC's IPaddress to the HP server's '/etc/hosts' file. Then telnet to your HP server again. If the delay vanishes it's the issue I suggested. In that case, make sure that your DNS configuration includes all pointers.

Regards!

...JRF...
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

Hi,

The server I'm trying to connect is already added to other server's /etc/hosts file, I think I'm not using DNS, could it be misconfigured? How can i verify this?
DCE
Honored Contributor

Re: Telnet is taking long time to connect



Make sure you /etc/nsswitch.conf file is configured to use files first, not dns
Prashant Zanwar_4
Respected Contributor

Re: Telnet is taking long time to connect

any errors on host?

dmesg? dmesg -

bdf ?

Check if any NFS mount is messed up.. many times it's issue.. !

Or any errors related to network?

Thanks and regards
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

Thks,

I renamed or moved the nsswitch.conf file 'cause I'm not using it, after that ssh works better, about DCE everythin it's ok
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

To make ssh not use DNS name you can simply edit: /etc/opt/ssh/sshd_config

and make sure this is set, by default is yes:
UseDNS no

Restarting the daemon (/sbin/init.d/secsh) should activate the changes.
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

Thks,

ssh is working well.

Let me try to explain myself better:

I have 3 servers. src_server (the one with the telnet problem), server_1 & server_2.

All the round robin ssh connections works fine.

server_1 telnets src_server ==> prompts for login after several mins.

server_2 behaves the same.

server_1 telnets server_2 ==> OK!

src_server telnets server_1 or server_2 ==OK

src_server telnets to itself ==> prompts for login after several mins.

Any help?
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

Telnet afaik does not use name resolution at all so having a reverse DNS does not matter. You probably have a routing issue especially if you have multiple NICs. Can you "print out" the routing table on that machine?
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

Ignore the first sentence, I assumed that your nsswitch.conf and direct name resolution works :) Do you use DNS?
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

Please ignore the first sentence above, I assumed that your nsswitch.conf and direct name resolution works :) Do you use DNS?
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

Do you use tcpwrappers or ipf on the src_server?
Are they all in the same subnet? Does telnet from src_server to src_server work normally?
DCE
Honored Contributor

Re: Telnet is taking long time to connect


The following two links are about the same issues you seem to be having.

The first addresses/explains the issues with resolv.conf, nsswitch.conf and /etc/hosts

The second details how the problem was corrected by installing a newer version of ssh

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=824370


http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=971375
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

James,

telnet from src_srv to src_srv takes long time to reply.

ssh from src_srv to src_srv work perfect.

The other things yo ask me i don't know

Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

Thks DCE,

SSH AGAIN WORKS OK!

I renamed the resolv.conf and nsswitch.conf files, the same did at srv_1 and srv_1 connect well to all servers except src_srv.

More ideas?

jamesps
Regular Advisor

Re: Telnet is taking long time to connect

On src_server if you look in your /etc/nsswitch.conf do you have something like this:

hosts: files dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return] files [NOTFOUND=continue UNAVAIL=continue]

If you do a ping src_server (from src_server) does that work without delays?

Can you run these:
#netstat -in
#ipfstat -io
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

Hi James,

ping from src_srv to src_srv work quickly.

The output of netstat is:

# netstat -in

Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll

lan0 1500 172.16.147.0 172.16.147.30 446562 2660 623343 0 75166

lo0 4136 127.0.0.0 127.0.0.1 2841 0 2841 0 0


where 172.16.147.30 is the src_srv ip_address

I don't have ipfstat

I try with the nsswitch.conf file, at "hosts" line "file" appears only once at the beginning.

What else?

jamesps
Regular Advisor

Re: Telnet is taking long time to connect

On src_srv if you do this:

#telnet localhost

Does it work normally?
Gamaliel
Frequent Advisor

Re: Telnet is taking long time to connect

James,

It also takes a long time to prompt for login.

But if at src_srv i ping for src_srv it answers inmediatly
jamesps
Regular Advisor

Re: Telnet is taking long time to connect

Verify if you have this line in /etc/inetd.conf (only once):

telnet stream tcp nowait root /usr/lbin/telnetd telnetd

Also this must exist in /etc/services:
telnet 23/tcp

If they do exist try this:
1. edit /etc/inetd.conf and comment out the telnet line
2. save the file
3. run #inetd -c
4. do a netstat and check if your port 23 is open
5. eventually try a #telnet localhost on that machine, you will get a prompt response: "telnet: Unable to connect to remote host: Connection refused"
6. if there is no other 23 open then there is no port "conflict" you can edit the /etc/inetd.conf back and uncomment the telnet line
7. run #inetd -c to activate the changes
8. try again telneting to the machine, use its IP address instead of name just to be sure

james