I have 2 computers on my network. Computer 1 (CentOS 6.2) and Computer 2(Ubuntu 11.10). I have Oracle 11g installed on Computer 1. When Computer 1's firewall is disabled, I Can connect (sqlplus system/manager@dev) to Oracle on Computer 1 without any problem. However, when I enable the firewall on Computer 1, I can't connect. So, I gave the following 2 commands on Computer 1 to Open up port 1521 without any luck. Iget host destination unreachable error. Can some one help me?
iptables -A INPUT -p tcp -s 0/0 sport 1024:65535 -d 192.168.1.20 dport 1521 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.1.20 sport 1521 -d 0/0 dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
The order or position of rules are important in order to function.
Rather then re-building the complete table from scratch you might want to use the "system-config-firewall" graphical user interface to add the TCP port 1521 from the "other ports" option. You don't need a rule for outgoing traffic.