I am trying to open a port (tcp 27017) for access to mongodb on a newly created RHEL 6.6 instance at Amazon AWS. Following mongo docs, I did:
sudo semanage port -a -t mongod_port_t -p tcp 27017
I also opened that port on the Amazon security group. But, I still get connection failure. I found a handy tip somewhere to test whether a port is reachable using:
If I use 127.0.0.1:27017 on the box, I get back a message like "Looks like you are trying to access a mongo server". If I instead plug in the host private IP address, or do it from another host, I get "Could not connect". If I repeat using port 22, I get SSH version echo.
When I do
sudo iptables -L it comes back with headings for INPUT/FORWARD/OUTPUT but no rules are displayed. Yet, I found in /etc/sysconfig/iptables where port 22 was being explicitly authorized. So I edited that file, duplicated that line, and did a reboot. That had not effect.
Any suggestions what is going on? I had been using ubuntu server, but for no particular reason, so I thought I would switch to Red Hat, but maybe a mistake.