2

I have set up an Amazon ec2 server but I want to open port 2195 and 443.

I already added ports from security group in Amazon console. When I listen port using

netstat -anltp | grep LISTEN
I got only two ports 23 and 80.

I also checked if ubuntu firewall is blocked or not.

divibisan
  • 11,659
  • 11
  • 40
  • 58
  • What service do you have listening to the other ports? All you need to do is open it in the security group and in some cases the system firewall. – datasage Mar 28 '13 at 11:02
  • I opened all ports and allow ports 2195 and 443 from system firewall.i need to allow 2195 because want to implement push notification feature for iphone. – Pankaj Sakariya Mar 28 '13 at 14:00

4 Answers4

2

After you add the ports in EC2 Security Group, they are ready to be used by any process. Restarting your EC2 instance is also not needed.

netstat -anltp | grep LISTEN

will start showing the new ports as soon as some process is started which LISTEN on them

raghavsood33
  • 749
  • 7
  • 17
0

Just restart the e2 instance and check it and make sure you have the saved the security group settings after adding the new ports.

Jeevan Dongre
  • 4,627
  • 13
  • 67
  • 129
0

iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport PORT_NO_U_WANTED_TO_OPEN -j ACCEPT

try this .

mbdvg
  • 2,614
  • 3
  • 21
  • 39
0

you can disable iptables on ec2 because because there is security group on console to limit open port, but here my solution if you still want to using it:

manual edit file /etc/sysconfig/iptables with the following step

  • flush iptables caches

    iptables -F

  • edit the file

    nano /etc/sysconfig/iptables

  • add you port and make sure the line like

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

  • and not

    -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

  • save and restart iptables

    service iptables save

    service iptables restart

ewwink
  • 18,382
  • 2
  • 44
  • 54