Visit Our UNIX and Linux User Community


opening ports


 
Thread Tools Search this Thread
Special Forums Cybersecurity opening ports
# 1  
Old 03-05-2002
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  
Old 03-05-2002
Are you asking how to open a hole in the firewall? If so, what version of the kernel are you running?
# 3  
Old 03-05-2002
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  
Old 03-05-2002
What process is listening on your port 3000?
# 5  
Old 03-05-2002
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  
Old 03-06-2002
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  
Old 03-06-2002
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.

Previous Thread | Next Thread
Test Your Knowledge in Computers #333
Difficulty: Easy
Linux was first developed as an alternative to Windows XP.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Who are all opening my datasets,?

Hi, I need a command/script, who opened my dataset, consider a situation like, if a user has opened the dataset few days back then, that command/script should list his/her id. I don't want audit on my dataset, i need only list of users who are using my dataset. Thank you. (10 Replies)
Discussion started by: subbarao12
10 Replies

2. Cybersecurity

Opening ports 8015/8016 restricted to selected IP addresses

Hello there I'm using a vendor-supplied application on RHEL4 that includes a built-in Tcl webserver. The webserver is working but I cannot access it from any computer other than the host workstation. I suspect that the firewall is blocking ports 8015/8016. I have two questions: 1. How do... (1 Reply)
Discussion started by: craig3201
1 Replies

3. Solaris

SMC not opening

I am working with Solaris 9.In that I am trying to open SMC(Solaris Management Console) but when I am clicking it,nothing is opening. Can any1 tell me why it is not opening??:confused: (1 Reply)
Discussion started by: smartgupta
1 Replies

4. Solaris

Please help with opening a port??

Hello all, I need assistance... I need to open a port # 36677 and have it remain open even after a power cycle. I thought all I needed to do was add it to /etc/services. That was not it... Can someone please tell me how to do this. Thank you. (6 Replies)
Discussion started by: komputersman
6 Replies

5. IP Networking

problem opening TCP ports

Please can somebody help me. I'm trying to open ports 999, 1982 and 1983 but am not having much luck. I used iptables -A INPUT -i eth0 -p tcp --sport 999 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 1982 -m state --state NEW,ESTABLISHED -j ACCEPT iptables... (5 Replies)
Discussion started by: thehaapyappy
5 Replies

6. UNIX for Dummies Questions & Answers

Opening TCP ports

I'm not sure if this is the right place for this post, but I'd be grateful if somebody could please help me. I'm trying to open ports 999, 1982 and 1983 but am not having much luck. I used iptables -A INPUT -i eth0 -p tcp --sport 999 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i... (2 Replies)
Discussion started by: thehaapyappy
2 Replies

7. AIX

Opening ports

Hi guys, I need to open ports on my AIX machine. The only way I know is to use service name to disable or enable ports which are used by the services. I found in /etc/services that the ports are unidentified. Btw, I want to open port number 11576 and 11577. Need help on this one. Thanks! :) (1 Reply)
Discussion started by: raskita
1 Replies

8. UNIX for Advanced & Expert Users

Opening CDE

I have installed JASS on one of my sun servers. I am now trying to open for CDE. For that I have done these steps: mv /etc/rc2.d/_S71rpc.JASS.* /etc/rc2.d/S71rpc mv /etc/rc2.d/_S99dtlogin.JASS* /etc/rc2.d/S99dtlogin but still no CDE. Any advice on this?? (3 Replies)
Discussion started by: encrypted
3 Replies

9. UNIX for Dummies Questions & Answers

Opening files

I am very new to unix. I want to open a file and read one line in at a time. Can anybody help? (3 Replies)
Discussion started by: saarshad001
3 Replies

Featured Tech Videos