The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Security
.
google unix.com



Security Discuss UNIX and Linux computer and network security, cybersecurity, cyberattacks, IT security, CISSP, OWASP and more.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem opening TCP ports thehaapyappy IP Networking 5 04-30-2008 08:25 AM
Opening TCP ports thehaapyappy UNIX for Dummies Questions & Answers 2 04-29-2008 11:52 AM
Opening ports raskita AIX 1 07-30-2007 09:18 AM
Opening CDE encrypted UNIX for Advanced & Expert Users 3 01-24-2005 12:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-05-2002
dryheat dryheat is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 8
opening ports

I need to open a port in linux to allow a connect() from another box to succeed. I have the linux box listening on port 3000 on INADDR_ANY, and a Windows box does a connect to the IP of the linux box on that same port. The Linux box refuses the connection. I think it's because all the ports are closed except for the well-known ones. I want to open just port 3000 but I can't figure out how to do it. I don't want to associate any service or executable with the connection.
  #2 (permalink)  
Old 03-05-2002
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Are you asking how to open a hole in the firewall? If so, what version of the kernel are you running?
  #3 (permalink)  
Old 03-05-2002
dryheat dryheat is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 8
Yes. I want to poke a hole in the firewall.
BTW, I don't think it's running any firewall daemon. At least I don't recall setting one up.
It's Kernel 2.4 (Redhat 7.2).
Thx.
  #4 (permalink)  
Old 03-05-2002
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,724
What process is listening on your port 3000?
  #5 (permalink)  
Old 03-05-2002
dryheat dryheat is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 8
My app. is listening. I create the socket, do the bind, listen, select, then accept when the select passes to set up the connection. These are stream-type TCP sockets. The code works fine locally, if I have the client and server on the same Windows machine. I haven't compiled the client on the Linux box yet.
  #6 (permalink)  
Old 03-06-2002
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Redhat 7.2 sets up an iptables-based firewall for you automatically during installation. To open a tcp port use something like:

iptables -A INPUT -s <source-ip/wildcard> -p tcp -m tcp --dport <port-number> -j ACCEPT


See the official HOWTo from one of the iptables authors here: http://netfilter.samba.org/unreliabl...WTO/index.html

See also: the iptables man page.

RedHat also comes with a GUI firewall configuration tool I believe.
  #7 (permalink)  
Old 03-06-2002
dryheat dryheat is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 8
I ported and compiled my client so they both ran on the Linux box, and I got the same error from connect() "ECONNREFUSED." I've also added an entry to /etc/services for my app and protocol/port and added a rule using ipchains. I also tried using both 127.0.0.1 and my LAN addr of the box 192.168.0.2 with the same result.
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 07:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0