Networking Forums

Networking Forums > Computer Networking > Linux Networking > Socket connection to port fails despite port open / listening !

Reply
Thread Tools Display Modes

Socket connection to port fails despite port open / listening !

 
 
Jack
Guest
Posts: n/a

 
      12-19-2007, 03:33 PM
Hi all,

I have opened port 5129 on 2 linux machines (CENTOS) and they are
listening - 1 machine accepts socket connections from a third windows
machine (all on same network) and the 1 doesnt !! What can I check ?

1- I ran this to verify ports:
open(PRTCP,'/proc/net/tcp');while(<PRTCP>){
chomp;next if/^\s*$/;s/^\s*//;s/\s*$//;next
if/^sl/;split/\s+/;@p=split':',$_[1];$h{hex
$p[1]}=$_[7];}foreach(sort{$a<=>$b}keys%h){
print$_,"\t",[getpwuid($h{$_})]->[0],"\n"};

RESULT: 5129 jack

2- "netstat -tap" shows its listening :
tcp 0 0 *:51295
*:* LIST
EN 7379/jacksprogram

3- iptables:
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -
j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5129
-j ACCEPT
COMMIT

 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a

 
      12-19-2007, 03:35 PM
On Dec 19, 8:33 am, Jack <jack_posem...@yahoo.com> wrote:
> Hi all,
>
> I have opened port 5129 on 2 linux machines (CENTOS) and they are
> listening - 1 machine accepts socket connections from a third windows
> machine (all on same network) and the 1 doesnt !! What can I check ?
>
> 1- I ran this to verify ports:
> open(PRTCP,'/proc/net/tcp');while(<PRTCP>){
> chomp;next if/^\s*$/;s/^\s*//;s/\s*$//;next
> if/^sl/;split/\s+/;@p=split':',$_[1];$h{hex
> $p[1]}=$_[7];}foreach(sort{$a<=>$b}keys%h){
> print$_,"\t",[getpwuid($h{$_})]->[0],"\n"};
>
> RESULT: 5129 jack
>
> 2- "netstat -tap" shows its listening :
> tcp 0 0 *:51295
> *:* LIST
> EN 7379/jacksprogram
>
> 3- iptables:
> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> :RH-Firewall-1-INPUT - [0:0]
> -A INPUT -j RH-Firewall-1-INPUT
> -A FORWARD -j RH-Firewall-1-INPUT
> -A RH-Firewall-1-INPUT -i lo -j ACCEPT
> -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
> -A RH-Firewall-1-INPUT -p 50 -j ACCEPT
> -A RH-Firewall-1-INPUT -p 51 -j ACCEPT
> -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
> -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
> -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
> -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -
> j ACCEPT
> -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
> -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5129
> -j ACCEPT
> COMMIT


typocorrection to above, its port 5129, not 51295 - What else can I
check ? A firewall config ? Something blocking TCP packets ? :
2- "netstat -tap" shows its listening :
tcp 0 0 *:5129
*:* LIST
EN 7379/jacksprogram
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      12-19-2007, 03:46 PM
Hello,

Jack a écrit :
>
> I have opened port 5129 on 2 linux machines (CENTOS) and they are
> listening - 1 machine accepts socket connections from a third windows
> machine (all on same network) and the 1 doesnt !! What can I check ?

[...]
> -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
> -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5129
> -j ACCEPT


The rule that accepts TCP connections on port 5129 is after the rule
that rejects everything, so it is useless.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to open more than one connection on same port? brekehan Linux Networking 4 03-20-2007 05:53 PM
TELNET Connection To Open Port Times Out PowerLifter1450@gmail.com Linux Networking 2 11-25-2006 08:27 PM
TELNET Connection To Open Port Times Out PowerLifter1450@gmail.com Linux Networking 0 11-24-2006 04:27 PM
open ports on the router port 1900udp and port 5643 tcp James Broadband Hardware 0 02-20-2005 08:07 AM
ipop3d - port open, but no connection Dorsai Linux Networking 7 01-14-2004 09:47 PM



1 2 3 4 5 6 7 8 9 10 11