![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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.
|
|
||||
|
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.
|
|
|||||
|
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. |
|
||||
|
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.
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|