我想在我的EC2实例上运行一个Java应用程序。 应用程序接受端口54321上的套接字连接。如果我尝试连接到它,超时。 我的安全组设置为:
TCP Port (Service) Source Action 21 0.0.0.0/0 Delete 22 (SSH) 0.0.0.0/0 Delete 80 (HTTP) 0.0.0.0/0 Delete 20393 0.0.0.0/0 Delete 54321 0.0.0.0/0 Delete
还有什么我需要做的?
# iptables -nvL Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination # iptables -nvL -t nat Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination #
我刚刚有这个完全相同的问题。 我正在运行一个RHEL实例,并且一直在困扰着我。
无论如何,感谢@mgorven(在OP评论中)指出我的方向是正确的,就是closuresLinux防火墙,因此:
[root@myserver ~]$ service iptables stop
这将closures防火墙,但是您还需要确保它在下次重新启动时不会重新启动:
[root@myserver ~]$ chkconfig iptables off
这解决了我的问题 – 希望能解决你的问题。
HTH