1835525 Members
3232 Online
110078 Solutions
New Discussion

Unable to telnet

 
Siju Jose_1
Frequent Advisor

Unable to telnet

HI all

I am facing problems in connecting to a newly installed machine using telnet with hostname.It works fine with IP address within the same network.I have entered hostname in /etc/hosts and my /etc/nsswitch.conf says
"hosts: files".

With hostname it is taking 5-6 minutes to get the login prompt within the same network and from outside network it says "telnet: Unable to connect to remote host: Connection timed out".

I am able to connect to this host from outside network immediately after it is rebooted.If I logout and try once more it is not connecting timesout after sometime.

I am confused and dont have any clue how to continue,I need help from all of you gurus.

Siju Jose
22 REPLIES 22
RAC_1
Honored Contributor

Re: Unable to telnet

Is name resolution (with ip address and with host name) OK??

Also check for following ndd setting. It should be 0. Should be disabled.

ndd -get /dev/ip ip_ire_gw_probe.

Anil
There is no substitute to HARDWORK
Mel Burslan
Honored Contributor

Re: Unable to telnet

This is definitely a name resolution issue. With the assumption thatyour /etc/hosts files is barebones, i.e., only the local server name and very few others, your waiting for the login prompt can be attributed to the waiting for timeout of the name resolution.

My first suggestion is, if you can, configure your server to use a dns server or 2 or 3 dns servers by modifying your /etc/resolv.conf and /etc/nsswitch.conf.

also, if dns is not an option, modify your nsswitch.conf as follows:

hosts: files [NOTFOUND=return]
________________________________
UNIX because I majored in cryptology...
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

HI

yes,the hostname resolution is correct and the ndd setting is also 0.But does it matter within the same network???

Thanks
Siju Jose
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

Hi Mel

DNS is not an option.I have changed the nsswitch.conf entry but the situation has not improved.
Also I cant understand why I am able to telnet immediately after this host is rebooted.

Thanks
Siju Jose
Devender Khatana
Honored Contributor

Re: Unable to telnet

Hi,

Try nslookup & traceroute commands for confirming the PATH & reason for dealy in the resolution.

HTH,
Devender
Impossible itself mentions "I m possible"
Bejoy C Alias
Respected Contributor

Re: Unable to telnet

How much time it takes to do nslookup ur hostname ? is it fast ? Try telneting to a non existant port like 1234 'telnet host 1234' , and check for any delay for getting the connection refused message .
Be Always Joy ......
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

HI

Please see the following.The difference to do traceroute to the same host is too large

spexts1[root]:/root:>timex traceroute 194.35.246.158
traceroute to 194.35.246.158 (194.35.246.158), 30 hops max, 40 byte packets
1 papaloco (194.35.246.158) 0.423 ms 0.221 ms 0.189 ms

real 0.02
user 0.00
sys 0.01

spexts1[root]:/root:>timex traceroute papaloco

traceroute to papaloco (194.35.246.158), 30 hops max, 40 byte packets
1 papaloco (194.35.246.158) 0.404 ms 0.213 ms 0.188 ms

real 5:40.21
user 0.01
sys 0.02


nslookup completes succeesfully without any time delay.

Regards
Siju Jose
Sarjerao
Frequent Advisor

Re: Unable to telnet

I think /etc/hosts and /etc/nsswitch.conf are related to resolution at local host only.
When you are using telnet from remote system it checks it own hosts file or dns server for ip resoltuion. This problem may be with you dns server.
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

Hi

There is no DNS involved in this.Both machines are in same network itself.

Siju Jose
PVR
Valued Contributor

Re: Unable to telnet

HI Siju

Please put the hostname and IP address of the server in the remote machine from where you telne to the newly installed machine.

Please let me know the OS of your remot machine. If you have a nix box int he network, please try from there and let us know.
Don't give up. Try till success...
PVR
Valued Contributor

Re: Unable to telnet

please put the IP address and hostname of the new server in the hosts file of remote machine
Don't give up. Try till success...
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

Hi PVR

The entries are already in place,It is reolving the hostname by nslookup also.

Siju Jose
PVR
Valued Contributor

Re: Unable to telnet

Is it a unix box what you are mentioning as remote machine ???
Don't give up. Try till success...
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

Yes ,both are HP-UX 11i boxes
David Child_1
Honored Contributor

Re: Unable to telnet

Could you run a traceroute from papaloco back to spext1 and post the results? Also, on papaloco run 'netstat -rn' and make sure there are entries for interface itself;

example;

Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
100.169.67.69 100.169.67.69 UH 0 lan7 4136
100.169.67.0 100.169.67.69 U 2 lan7 1500

If these are missing it will use the default route to get to this network.

David
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

HI David

From papaloco it seems to be fast

papaloco[root]:/root:>timex traceroute spexts1
traceroute to spexts1 (194.35.246.155), 30 hops max, 40 byte packets
1 spexts1 (194.35.246.155) 0.457 ms 0.469 ms 0.283 ms

real 0.03
user 0.01
sys 0.02

papaloco[root]:/root:>timex traceroute 194.35.246.155
traceroute to 194.35.246.155 (194.35.246.155), 30 hops max, 40 byte packets
1 spexts1 (194.35.246.155) 0.485 ms 0.397 ms 0.308 ms

real 0.03
user 0.01
sys 0.02

Also there are entries for interface also
papaloco[root]:/root:>netstat -nr
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
194.35.246.158 194.35.246.158 UH 0 lan1 4136
David Child_1
Honored Contributor

Re: Unable to telnet

Perhaps this could be a duplicate MAC address issue. Try the following;

on spexts1 run;

$ lanscan

Get the station address (MAC) for the interface for that network.

Then on papaloco run;

$ arp -a | grep spexts1 (or use -an and grep for the IP)

If the MAC addresses don't match you have another interface out there with the same MAC. Everything might work fine right after a reboot because the arp table is empty. At some point the rogue interface might respond and get itself into the arp table.

A slim chance I know, but it may be worth a look.

David
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

Hi

It matches the lanscan output.

Siju
Siju Jose_1
Frequent Advisor

Re: Unable to telnet

HI

I am able to ftp with hostname without any delays,it gets connected instanmtly.Only telnet is having issues.Can somebody help???

Siju Jose
PVR
Valued Contributor

Re: Unable to telnet

Sijo

Can you try the command inetd -c and try with telnet again ?

I prefer you to kill telned processes in the system and execute the command inetd -c.

Thanks
PVR
Don't give up. Try till success...
Pradeep_3
Frequent Advisor

Re: Unable to telnet

try ping with hostname or ip address and
run the command arp -a to check for arp cache entries.it will show if there are any duplicate entries.

check file /var/adm/inetd.sec for login and telnet allows entry.
Ermin Borovac
Honored Contributor

Re: Unable to telnet

Does delay also happen when connecting from the host itself? Can you try this on the server where you are connecting to?

So you have

$ telnet
... delay ...

But also try

$ telnet localhost

and see if you get delay.

This may indicate the corruption of /etc/utmp and /etc/utmpx files. It's been fixed with the following patch

Patch Name: PHNE_28841
Patch Description: s700_800 11.11 telnet kernel, telnetd(1M), telnet(1) patch

However, after installing the patch you will need to zero out /etc/utmp and /etc/utmpx files (you can do this in single user mode).

Otherwise, your problem sounds remarkably like a name resolution issue. If you have /etc/resolv.conf verify that you have valid entries in there.

Check name resolution with nsquery for both name and IP.

$ nsquery hosts
$ nsquery hosts

$ nsquery hosts
$ nsquery hosts

Lastly, if someone configured duplicate IP on the network that conflicts with your server IP you would see relevant entries in the output of

# netfmt -f /var/adm/nettl.LOG000