Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On Fedora I tried to access port 1521, so I opened the following port on my firewall:

$ sudo iptables -I INPUT -i eth0 -p tcp -m tcp --dport 1521 -j ACCEPT
$ sudo service iptables save

I then tried to telnet to my inner IP (the IP that the router gave me) and got connection refused:

$ telnet 192.168.1.103 1521
Trying 192.168.1.103...

telnet: connect to address 192.168.1.103: Connection refused

I then tried to telnet to my internet IP and didn't get any response:

$ telnet x.x.x.x 1521
Trying x.x.x.x...

As far as I can tell, I've opened my port on the router also, BTW, I also tried it with port 22 and got the same result.

share|improve this question
    
you may have better luck on Server Fault. –  strugee Jul 28 '13 at 22:34
2  
is there actually a listening socket on that port? netstat -tnl | grep :1521 –  Wumpus Q. Wumbley Jul 28 '13 at 22:47
    
yes there is, oracle listener –  nir Jul 29 '13 at 8:17
add comment

1 Answer 1

I would try something like this. I don't believe the -m switch can take the argument tcp.

Based on the state of the connection being "new":

$ iptables -A INPUT -m state --state NEW -p tcp --dport 1521 -j ACCEPT

Accept any connections on port 1521:

$ iptables -I INPUT -p tcp --dport 1521 -j ACCEPT

Also is there a daemon listening on this port 1521?

share|improve this answer
    
didnt helped. there is an oracle listener, i'm trying telnet and also tnsping. –  nir Jul 29 '13 at 8:20
    
Can you telnet localhost 1521 on the actual host running Oracle? –  slm Jul 29 '13 at 11:48
    
Yes I can, and also 192.168.1.103 is good. but not the internet ip –  nir Jul 29 '13 at 12:21
    
@nir - then your issue likely lies with the router. It doesn't appear to be forwarding traffic correctly to port 1521 on host 192.168.1.103. What you have here is all you need to do to accept the traffic on port 1521 on the linux box's firewall. –  slm Jul 29 '13 at 19:10
    
ok i'll continue digging, thanks anyway –  nir Jul 29 '13 at 19:53
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.