"Connection closed by foreign host error" in Solaris 10


 
Thread Tools Search this Thread
Operating Systems Solaris "Connection closed by foreign host error" in Solaris 10
# 1  
Old 11-07-2012
"Connection closed by foreign host error" in Solaris 10

Version Details
Code:
Solaris version :  Oracle Solaris 10 8/11 s10x_u10wos_17b X86
$ uname -a
SunOS tippy178 5.10 Generic_147441-01 i86pc i386 i86pc

The Issue
+++++++++

I have two solaris 10 Virtual Machines created using Virtual Box. One of my applications running on Source was trying to connect to Target

Source: 192.168.0.178
Target : 192.168.0.179

Application got the following error

Code:
TCP/IP error 146 (Connection refused), endpoint: 192.168.0.179:15001

So, I did a telnet test from source to target. But I was getting 'Closed by foreign host' error. It seems to get connected for a second, but then I get the 'closed by foreign host' error

Code:
$ telnet 192.168.0.179 15001
Trying 192.168.0.179...
Connected to 192.168.0.179.
Escape character is '^]'.
Connection to 192.168.0.179 closed by foreign host.

But , ping is working fine
Code:
$ ping 192.168.0.179
192.168.0.179 is alive

And I am able to ssh from source to the target machine without any issues.


After some googling, I uncommented the following line in /etc/inetd.conf

Code:
tftp    dgram   udp6    wait    root    /usr/sbin/in.tftpd      in.tftpd -s /tftpboot

But i don't think it has any effect in Solaris 10.

Any suggestions on how to fix this ?
# 2  
Old 11-07-2012
So first of all:-
  • Why are you targeting port 15001? Port 15001 is not a standard port number that I am aware of. I presume you have some reason for it.
  • Is the port in /etc/services? Could you post the output from grep 15001 /etc/services
  • Is the service in /etc/inetd.conf? Using the name returned above (e.g. my-svc tcp/15001) could you post the output from grep my-svc /etc/inetd.conf
  • Is the server listening? On the target server, could you run netstat -na|grep 15001 and post the response. If you have lsof installed, could you post the output from lsof -i tcp:15001
  • Is the listener logging an error, if you know where it would?

From your telnet attempt, it would suggest that the server is listening, but doesn't respond to telnet, and why should it. It is presumably a different service.

What more can you tell us?




Thanks, in advance,
Robin
Liverpool/Blackburn
UK
This User Gave Thanks to rbatte1 For This Post:
# 3  
Old 11-07-2012
Thank you Robin.

In Target, I started a process called MANAGER , and I got the following message from its log

Code:
2012-11-07 22:43:19  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 15001).

It seemed to be running. But 15001 port is not listed in /etc/services.


Code:
# grep 15001 /etc/services
# netstat -na|grep 15001
      *.15001              *.*                0      0 49152      0 LISTEN
      *.15001                           *.*                             0      0 49152      0 LISTEN
# lsof not installed
# lsof -i tcp:15001
lsof: not found

What is the port range I should be using ? I am not a network person. Smilie

Do you want me to cat /etc/services or any other file from Target ?
Thank you.
# 4  
Old 11-07-2012
hi,

If port 22 (ssh) run fine and the 15001 not :

and if that
Code:
# netstat -na|grep 15001
      *.15001              *.*                0      0 49152      0 LISTEN
      *.15001                           *.*                             0      0 49152      0 LISTEN

Me i should ask to the networkteam if firwall rule allow port 15001 on your box.

I have allready seen a firwall that said that to me
Code:
$ telnet 192.168.0.179 15001
Trying 192.168.0.179...
Connected to 192.168.0.179.
Escape character is '^]'.
Connection to 192.168.0.179 closed by foreign host.

It was a msg sent by firwall not by your target hosts. For security reason.

hope it help
This User Gave Thanks to sylvain For This Post:
# 5  
Old 11-07-2012
In target, I tried to start this service ( 'manager' ) on different ports like 8000, 2000, 1532

Still the issue persists. Currently I am trying to start manager process in 1532 in target.

Code:
$ netstat -na| grep 1532
      *.1532               *.*                0      0 49152      0 LISTEN
192.168.0.179.1532   192.168.0.178.32862  49640      0 49640      0 TIME_WAIT
      *.1532                            *.*                             0      0 49152      0 LISTEN

--- Trying telnet from source
Code:
$ telnet 192.168.0.179 1532
Trying 192.168.0.179...
Connected to 192.168.0.179.
Escape character is '^]'.
Connection to 192.168.0.179 closed by foreign host.

---------- Post updated at 10:30 AM ---------- Previous update was at 10:24 AM ----------

Thank you Sylvian .
These solaris machines are virtual machines running is my home based network.
Code:
Guest OS         : Solaris 10 
Host OS         : Windows 7
Virtual Box version: 4.1.18-78361-Win

I haven't enabled any firewall . Is there any way I could disable it ?
# 6  
Old 11-07-2012
On each (virtual) machine try:

Code:
telnet localhost

to see if it can telnet to itself. This would use port 23, of course.

This will test whether the system will accept connections which are not from "foreign host".
# 7  
Old 11-08-2012
I tried changing the port to 2012 and restarted the service in target. Now, when I try to telnet from source the telnet command hangs. I kept trying Ctrl+C to get the prompt back, but not luck. I had to close and start another putty session.

Source: 192.168.0.178
Target : 192.168.0.179 (the server which has the port I want to check if it is open)


-- Trying to check if port 2012 in 192.168.0.179 is open
-- From 192.168.0.178 I am running the below telnet command
Code:
$ telnet 192.168.0.179 2012
Trying 192.168.0.179...
Connected to 192.168.0.179.
Escape character is '^]'.
^C
^C^C^C^C

^C^C
^D



--- Netstat Output from Target
-- When trying to access 192.168.0.179:2012


Code:
$ netstat -na | grep 2012
192.168.0.179.2012   192.168.0.178.32813  49640      0 49617      0 ESTABLISHED
      *.2012               *.*                0      0 49152      0 LISTEN
192.168.0.179.2012   192.168.0.179.32802  49152      0 49256      0 ESTABLISHED
192.168.0.179.2012   192.168.0.178.32809  49640      0 49593      0 CLOSE_WAIT
192.168.0.179.2012   192.168.0.178.32811  49640      0 49613      0 CLOSE_WAIT
      *.2012                            *.*                             0      0 49152      0 LISTEN



Hi Hicksd8 ,


In target i did the telnet test you asked for

-- Trying to telnet to same machine.

Code:
$ telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login: oracle
Password:
Last login: Thu Nov  8 22:18:20 from tigris179
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
$
$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Telnet in script Connection closed by foreign host

Hello, I'm trying to learn and automate some tasks via a script, but my first ever script failed with "connection closed by foreign host" error. I checked the other discussions but it didn't help. Could you please help? #!/bin/bash ( sleep 2 echo open x.x.x.x 23 sleep 2 echo user sleep 2... (1 Reply)
Discussion started by: Myrtle
1 Replies

2. Shell Programming and Scripting

Telnet error- Escape character is '^]' and connection closed by foreign host

In program, I want to telnet the ports present in telnet.txt file and capture screenshot of open port which is opened on new terminal. Problems: Escape character is '^]' and Connection closed by foreign host. Loop is not working properly. It only take one ports and closed the connection. ... (9 Replies)
Discussion started by: sk151993
9 Replies

3. Shell Programming and Scripting

Telnet Bash Script (Connection closed by foreign host.)

Hello Everyone, My following script is giving me problems, when the SIP trunk goes down and the telnet session is started and just when the command is about to complete the connection is closed then script restarts. I have noticed that as soon the script types in "sys re" or "sys rebo" or... (6 Replies)
Discussion started by: jeetz
6 Replies

4. Red Hat

Connection closed by host error in rhel 6 Linux

Hi All, I am new to Redhat Enterprise Linux 6 version. I am facing an issue with my lab server which is having RHEL6 lab1:root> uname -a Linux lab1 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 17:04:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux I am getting this error for every 18 minutes 30... (0 Replies)
Discussion started by: go2suresh1979
0 Replies

5. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

6. Solaris

"Connection closed by" error

OS: Solaris 8 Sparc server1:userA:/home/userA# ssh userB@server1 Connection closed by < IP address> Problem: From being a userA, I am unable to connect/ssh to the same server as when trying to use a different account. (userB) Do you know where can i start checking? Here are some... (3 Replies)
Discussion started by: hrist
3 Replies

7. Shell Programming and Scripting

shell script/telnet - Remove/Control "Connection closed by foreign host"

How do I gain control of the "Connection closed by foreign host" message telnet yields when you connect to it in a shell script? I'm using the output: #!/usr/local/bin/bash count=$(ping -c 1 $1 | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }') if ; then echo "$1 PING "... (2 Replies)
Discussion started by: phpfreak
2 Replies

8. UNIX for Advanced & Expert Users

"Connection closed by remote host" while doing ssh to a solaris box

Hi All, When i try to do ssh from a linux to solaris box its throughing "Connection closed by remote host". Please not that this error is not occuring every time i do ssh, it occurs at random timing( Mostly ssh is successful) - unfortunately my script which is doing ssh is falling at this time... (4 Replies)
Discussion started by: pkumar7
4 Replies

9. UNIX for Dummies Questions & Answers

ssh_exchange_identification: Connection closed by remote host Connection closed

Hi Everyone, Good day. Scenario: 2 unix servers -- A (SunOS) and B (AIX) I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time. Some of these sftp's fail with the following error: ssh_exchange_identification: Connection... (1 Reply)
Discussion started by: jeevan_fimare
1 Replies

10. Cybersecurity

"421 service not available, remote server has closed connection."?

"421 service not available, remote server has closed connection." I tried to do ftp to one of the unix server . ftp hostname password It get connects when i do any command it throws error ftp> ls "421 service not available, remote server has closed connection." (1 Reply)
Discussion started by: vishaldsh
1 Replies
Login or Register to Ask a Question