Amazon EC2 上的非常用端口
假设我想24/7监听一个非公共端口(例如9090)并在另一个非公共端口(例如8980)发送数据。
这在 Amazon EC2 实例中可能吗? (Windows 2003 或 2008)
注意:我做了一些搜索,发现如果我想这样做;然后我必须打开所有端口;这对我来说似乎是错误的。
Assume that I want to listen to a non-common port (9090 for example) 24/7 and send data on another non-common port (8980 for example).
Is that possible in an Amazon EC2 instance? (Windows 2003 or 2008)
Note: I have done some search and I have found that if I want to do so; then I have to open ALL ports; which does seem wrong to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的。
环境没有什么特别的地方会阻止你这样做。也就是说,您必须修改实例的安全组才能允许此通信。并确保任何实例级防火墙也允许这种通信。
您不必打开所有端口,这是肯定的!你从哪里得到的?
Yes, it is possible.
There is nothing special about the environment that would prevent you from doing so. That said, you will have to modify the security group(s) for the instances so as to allow this communication. And ensure any instance-level firewalling allows this communication also.
You should not have to open all ports, that is for sure! Where did you get that from?
这绝对是可能的,但请注意,EC2 尚不提供 Windows 2008 - 仅提供 Windows 2003。EC2
本身有一个入站防火墙,由您为帐户设置的安全组控制。 EC2 实例可能运行软件防火墙,该防火墙可以控制入站和出站流量。最常见的软件防火墙是 iptables - 如果它正在运行,那么您可能需要将其配置为允许两个端口通过(一个入站,另一个出站)。
在任何情况下,您都需要设置安全组以允许从整个互联网 (CIDR 0.0.0.0/0) 或子网范围访问侦听端口。您可以从 AWS 管理控制台 Web 界面执行此操作。
然后,在实例本身上,您可以将流量转发到任何您想要的地方。使用您想要执行此转发的任何软件。
It's definitely possible, but note that EC2 does not offer Windows 2008 yet - just Windows 2003.
EC2 itself has an inbound firewall which is controlled by the Security Groups you've set up for your account. EC2 instances might be running a software firewall, which can control both inbound and outbound traffic. The most common software firewall is iptables - if it's running then you'll likely need to configure it to allow both ports to pass through (one inbound, the other outbound).
In any case you'd need to set up your security group to allow access to the listen port, either from the entire internet (CIDR 0.0.0.0/0) or a sub-network range. You can do this from the AWS Management Console web interface.
Then, on the instance itself, you'd forward the traffic any where you want. Use whatever software you want to perform this forwarding.