Open firewall port on Fedora 14

2

I want to open the port 18680 on my remote Fedora 14 machine. I did

sudo iptables -I INPUT -p tcp --dport 18680 -m state --state NEW,ESTABLISHED -j ACCEPT

sudo iptables -I OUTPUT -p tcp --sport 18680 -m state --state ESTABLISHED -j ACCEPT

sudo service iptables save

The status returned is OK.

I have also opened the port on my security group on Amazon. Also, I rebooted the machine.

When I use the browser to view the application running at port 18680 the browser cannot connect.

What am I doing wrong?

Alex

Posted 2011-04-17T00:40:09.910

Reputation: 125

Answers

3

In the AWS management console.

  1. Go to Amazon EC2 TAB

  2. Click on Instances and note the Security Group Name from the Security Group column for the instance you want to open it for.

  3. Click on the link Security Groups

  4. Click on the Security Group Name from step 2.

  5. You should see a dropdown, click it and select Custom

  6. Enter:

    Protocol                  TCP
    From Port                 18680
    To Port                   18680
    Source (IP or Group)      0.0.0.0/0       -- NOTE 1
    
  7. Click Save.


On Fedora to open a port on the ipables firewall you would either run the command:

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dports 18680 -j ACCEPT

or directly edit the config file /etc/sysconfig/iptables:

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

Then save the changes with:

service iptables save

After that you can verify if the port is open with the command:

netstat -tulpn | less

And make sure the rule is in place with:

iptables -L -n

or

service iptables status

Also if u ever need you can restart iptables with:

servce iptables restart

Guapo

Posted 2011-04-17T00:40:09.910

Reputation: 210

I tried what you are suggesting but still it is not working. – Alex – 2011-04-17T13:22:57.160