• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Not able to telnet to 9922 port

 
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using RHEL 5.1 and am facing one problem.
when i do a netstat -an | grep 9922

its showing (hostname):9922 LISTEN

but when i telnet as
telnet localhost 9922

its showing me

But when am telneting to the same hostname its connecting.

telent hostname 9922

its connecting
and showing connected.

My question is why am not able to use localhost instead of actual host name if am doing telnet from the same machine.

I have all required entries in /etc/hosts.. entries are:



Thanks,
-Ricky
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a wild guess: when an app opens a port, it gives two pieces of info: the port number and the IP address. The app then listens to that port only on that IP address. I suspect that the telnet daemon is listening on the host's IP address (192.x.x.2), and not on 0.0.0.0 (which means listen on all IP addresses) or 127.0.0.1.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So then how I'll enable it to listen on all ports.

If there any config changes I need to make.

As the same configuration was working on RHEL4.x

And also I start my server always with bind option as -b 0.0.0.0

dont know then why its not binding to all .


Thanks.
-Ricky
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wait a minute, what application are you running that is taking a "-b 0.0.0.0" argument? So far I have been assuming you are trying to connect to the telnet daemon.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its my Java application which has webservice port 9922 deployed on Websphere 6.1

I used to check whether the port is accepting or not by telnet to tat port.
In my deployed application config file i mentioned localhost as agenthostname and webserviceport as 9922
so all calls goes like localhost:9922/blah format.

I'm using localhost instead of hostname because if i use localhost then i can copy paste the same config file to different machines in case of cluster rnv. once config file gets generated.

it was a regular practice for us till RHEL 4.x.x but i dont know why the same is not working in ver.5.

My question is if I'm getting the port and hostname listening then why i cant connect through localhost and the same port number.(min localhost should redirect to actual hostname as this all was working in previous RHEL versions)

Now the 2 work arounds are: ( Both works but i dont recomend):
1st one :I have to give hostname instead of localhost in my Apps config file. (Machine dependent config file cant do a copy paste to all machines)
2nd one: I have to edit the etc/hosts file and put hostname entry just before the localhost entry like

I dont recomend both work arounds.

Thanks.
-Ricky
[ November 05, 2008: Message edited by: Ricky Boxon ]
 
Saloon Keeper
Posts: 25481
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Use netstat -ln to determine whether the port is accessible. Normally localhost references would route through the loopback device.

2. Check iptables to make sure it isn't blocking. Out of the box, the stock RHEL iptables firewall setup should allow unlimited access from localhost, but if someone deleted that rule, you'd have a problem.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Checked both.

Made a netstat -ln | grep 9922

Firewall is disabled.


All accept.

I dont know what is wrong.. :roll:

Thanks,
-Ricky
[ November 06, 2008: Message edited by: Ricky Boxon ]
 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic