Can't connect to Monet DB hosted in RHEL5

0

I'm not a sysadmin, much less a RHEL sysadmin, but for some reason I have to make a few config changes in a couple RHEL servers.

I have to set up a couple services in different RHEL servers and they should be able to connect to each other. In one of them, the application server, I managed to open up port 8080 on iptables and it's accepting incoming connections from remote machines. But on the other one, the database server, I don't seem to be able to open up port 54321, which Monet DB is currently using, and I can connect to it only if I stop iptables.

Output of netstat -lnp:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      4252/./hpiod        
tcp        0      0 0.0.0.0:777                 0.0.0.0:*                   LISTEN      3987/rpc.statd      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      3942/portmap        
tcp        0      0 0.0.0.0:54321               0.0.0.0:*                   LISTEN      2792/monetdbd       
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      4273/sshd           
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      4285/cupsd          
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      4347/sendmail       
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      4257/python         
udp        0      0 0.0.0.0:771                 0.0.0.0:*                               3987/rpc.statd      
udp        0      0 0.0.0.0:774                 0.0.0.0:*                               3987/rpc.statd      
udp     1912      0 0.0.0.0:41740               0.0.0.0:*                               2792/monetdbd       
udp        0      0 0.0.0.0:48280               0.0.0.0:*                               4469/avahi-daemon   
udp        0      0 0.0.0.0:54321               0.0.0.0:*                               2792/monetdbd       
udp        0      0 0.0.0.0:5353                0.0.0.0:*                               4469/avahi-daemon   
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               3942/portmap        
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               4285/cupsd          
udp        0      0 10.1.1.152:123              0.0.0.0:*                               4313/ntpd           
udp        0      0 127.0.0.1:123               0.0.0.0:*                               4313/ntpd           
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               4313/ntpd           
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     10042  3348/iscsid         @ISCSIADM_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     443552 2792/monetdbd       /tmp/.s.monetdb.54321
unix  2      [ ACC ]     STREAM     LISTENING     443556 2792/monetdbd       /tmp/.s.merovingian.54321
unix  2      [ ACC ]     STREAM     LISTENING     15085  4599/gam_server     @/tmp/fam-root-
unix  2      [ ACC ]     STREAM     LISTENING     11367  4065/sdpd           /var/run/sdp
unix  2      [ ACC ]     STREAM     LISTENING     14449  4411/xfs            /tmp/.font-unix/fs7100
unix  2      [ ACC ]     STREAM     LISTENING     14994  4548/gdm-binary     /tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     443673 2806/mserver5       /home/pentaho/tumsdw/tumsdw/.mapi.sock
unix  2      [ ACC ]     STREAM     LISTENING     15024  4594/Xorg           /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     11476  4136/pcscd          /var/run/pcscd.comm
unix  2      [ ACC ]     STREAM     LISTENING     11507  4146/acpid          /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     13088  4049/python         /var/run/setroubleshoot/setroubleshoot_server
unix  2      [ ACC ]     STREAM     LISTENING     13764  4285/cupsd          /var/run/cups/cups.sock
unix  2      [ ACC ]     STREAM     LISTENING     10025  3342/iscsiuio       @ISCSID_UIP_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     14629  4469/avahi-daemon   /var/run/avahi-daemon/socket
unix  2      [ ACC ]     STREAM     LISTENING     14204  4373/gpm            /dev/gpmctl
unix  2      [ ACC ]     STREAM     LISTENING     11533  4155/hald           @/var/run/hald/dbus-ETzjGIzvFr
unix  2      [ ACC ]     STREAM     LISTENING     11532  4155/hald           @/var/run/hald/dbus-8lZKbUmyAE
unix  2      [ ACC ]     STREAM     LISTENING     10262  3457/mcstransd      /var/run/setrans/.setrans-unix
unix  2      [ ACC ]     STREAM     LISTENING     10659  3798/audispd        /var/run/audispd_events
unix  2      [ ACC ]     STREAM     LISTENING     11238  4037/dbus-daemon    /var/run/dbus/system_bus_socket

And content of /etc/sysconfig/iptables:

# Generated by iptables-save v1.3.5 on Wed Oct 29 17:00:09 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [105:16246]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -i eth0 -p tcp -m tcp --dport 54321 -j ACCEPT 
-A INPUT -j RH-Firewall-1-INPUT 
-A FORWARD -j RH-Firewall-1-INPUT 
-A RH-Firewall-1-INPUT -i lo -j ACCEPT 
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT 
-A RH-Firewall-1-INPUT -p esp -j ACCEPT 
-A RH-Firewall-1-INPUT -p ah -j ACCEPT 
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT 
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT 
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT 
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited 
COMMIT
# Completed on Wed Oct 29 17:00:09 2014
# Generated by iptables-save v1.3.5 on Wed Oct 29 17:00:09 2014
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [2:170]
:OUTPUT ACCEPT [2:170]
COMMIT
# Completed on Wed Oct 29 17:00:09 2014

As far as I can tell, this config matches exactly the other server's (apart the change from port 8080 to 54321), but with iptables started I can't connect to it remotely (I can connect locally without issue, though).

Any thoughts?

nsousa

Posted 2014-10-30T10:12:28.813

Reputation: 103

Answers

1

add the below line in "/etc/sysconfig/iptables"

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 54321 -j ACCEPT

Restart iptables.

/etc/init.d/iptables restart

Make sure iptables is allowing port 54321 connection:

iptables -L -n

vembutech

Posted 2014-10-30T10:12:28.813

Reputation: 5 693