Hi,
I'm having trouble with my instance having ports randomly closing or filtered out. When I run
netstat -tulpn | grep LISTEN
I get the following:
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:42271 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 :::8888 :::* LISTEN 2134/java
tcp 0 0 :::20540 :::* LISTEN 2134/java
tcp 0 0 :::7777 :::* LISTEN 2134/java
tcp 0 0 :::7878 :::* LISTEN 2134/java
tcp 0 0 :::18600 :::* LISTEN 2134/java
tcp 0 0 :::18505 :::* LISTEN 2134/java
tcp 0 0 :::18506 :::* LISTEN 2134/java
tcp 0 0 :::18573 :::* LISTEN 2134/java
tcp 0 0 :::36525 :::* LISTEN -
tcp 0 0 :::18510 :::* LISTEN 2134/java
tcp 0 0 :::18511 :::* LISTEN 2134/java
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::8080 :::* LISTEN 2134/java
tcp 0 0 :::18512 :::* LISTEN 2134/java
tcp 0 0 :::22 :::* LISTEN -
This shows some ports e.g. 18505, 18506 opened and listening.
My EC2's attached security group has those ports listed as open to all incoming traffic. The question is, when I try to connect to it from my home computer, the connection is refused. Port mappers like nmap show the port as filtered. Spinning up another instance and moving the EBS volume over and reassigning the elastic IP seemed to work, but then when I changed the instance type, the same problem is occurring again.
ifconfig on the host shows:
eth0 Link encap:Ethernet HWaddr 02:D6:91:DE:97:0F
inet addr:xxx.yy.z.ww Bcast:xxx.yy.zz.255 Mask:255.255.240.0
inet6 addr: fe80::d6:91ff:fede:970f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1
RX packets:2041 errors:0 dropped:0 overruns:0 frame:0
TX packets:2518 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240515 (234.8 KiB) TX bytes:308430 (301.2 KiB)
On the host, using nc to connect to both localhost and xx.yy.z.ww above (redacted for privacy) connect fine. Connecting to the elastic IP does not.
How can I diagnose where the issue is and restore connectivity?