LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2009, 09:53 AM   #1
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Rep: Reputation: 21
Can telnet to localhost but not IP address


Hi,

For an installation of SAP on RHEL5 I'm facing the problem below when trying to open a telnet session to SAP:
Code:
sap02# telent sap02 51208
Trying 192.168.1.131...
telnet: connect to address 192.168.1.131: connection refused
telnet: Unable to connect to remote host: connection refused
In this case 192.168.1.131 is the correct IP address for the machine on eth0

The strange thing is that when I try:
Code:
sap02# telnet localhost 51208
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
....
It just works. Quite annoying, since I need it to go via the IP address. (If I telnet to that directly it fails as well with the connection refused error).

Just to make sure that the firewall isn't bothering me, I disabled it for the time being.

Any suggestions why this is happening?
 
Old 07-15-2009, 10:04 AM   #2
saivin
Member
 
Registered: Dec 2008
Location: Bengaluru, India
Distribution: CentOS, openSUSE, Mandriva, Slackware
Posts: 111

Rep: Reputation: 19
localhost is your computer and it always defaults to loopback address 127.0.0.1. SAP is mostly another machine. If you want to access it, its IP-host match information should be in your /etc/hosts file.

edit /etc/hosts file to include
Code:
192.168.1.131   sap02
then you may have to relogin or restart the network.

Btw, what is that 51208 thing?

Last edited by saivin; 07-15-2009 at 10:08 AM.
 
Old 07-15-2009, 03:20 PM   #3
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by saivin View Post
localhost is your computer and it always defaults to loopback address 127.0.0.1. SAP is mostly another machine. If you want to access it, its IP-host match information should be in your /etc/hosts file.

edit /etc/hosts file to include
Code:
192.168.1.131   sap02
then you may have to relogin or restart the network.

Btw, what is that 51208 thing?
Hi,

I'm trying both from the sap02 machine. So both telnet sessions end up on localhost. The issue is that the one coming form the loopback interface works and the one on eth0 doesn't.

And 51208 is some SAP port (I'm no SAP expert either; I just provide the Linux service to those SAP guys).
 
Old 07-15-2009, 07:21 PM   #4
saivin
Member
 
Registered: Dec 2008
Location: Bengaluru, India
Distribution: CentOS, openSUSE, Mandriva, Slackware
Posts: 111

Rep: Reputation: 19
Ok, got your point. On my machine localhost works and so does the ip received by dhcp say 192.168.0.2. But on yours only localhost is pinging but not the ip received by dhcp (or manually configured ip).

Is your ip address given by dhcp service or you have manually configured the ip. If it is manually configured, then its information (as given in earlier post) should be in /etc/hosts. If it is automatic via dhcp, make sure you are able to access (ping/telnet) other machines in the network or the internet (if internet connection is enabled)?
 
Old 07-15-2009, 10:25 PM   #5
jhcaiced
Member
 
Registered: Mar 2009
Distribution: CentOS - Ubuntu - Debian
Posts: 83

Rep: Reputation: 27
In RHEL you should add the telnetd permission in /etc/hosts.allow
IIRC something like:

in.telnetd : 192.168.1. : allow

By default the remote access to some services is restricted.

Also you should check if the firewall is allowing the connections
to your SAP port, check /etc/sysconfig/iptables and add a line
like:
-A RH-Firewall-1-INPUT --dport 51208 -j ACCEPT

Then restart your firewall
/etc/init.d/iptables restart

Hope it helps.
 
Old 07-16-2009, 03:10 AM   #6
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Original Poster
Rep: Reputation: 21
Hi,

Thanks for all the help. Unfortunately I still can't telnet to the service on eth0. I'm starting to wonder if this is more a SAP issue then network.

The IP is manually configured. I do have the entry in /etc/hosts, and a DNS server resolving the machine.

The firewall is disabled so that's not blocking.

Also, I can't find any entry of this in /var/log/messages or /var/log/security. And a tcpdump doesn't seem to contain any entries for this port.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet - FAIL: telnet address from=15.8.29.14 gruell Linux - Software 1 06-28-2007 03:41 PM
postfix: i cantelnet localhost, but not telnet ip address efm Linux - Networking 1 02-27-2006 05:41 AM
Telnet problem and localhost zillah Linux - Wireless Networking 6 06-07-2005 02:34 PM
can not telnet localhost 25 but telnet dowell.exper.dynserv.com 25 exper Linux - Software 0 02-25-2004 05:13 AM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration