我创build了一个EC2安全组,允许来自同一个帐户中私人IP地址的传入stream量。
我的理解是,经典实例的私有IP地址在重启后可能会更改。 所以这个规则在重启后可能是无效的。
( https://stackoverflow.com/questions/10733244/solution-for-local-ip-changes-of-aws-ec2-instances )
我真的只想使用一个DNS名称作为来源,但这似乎不可能。 我不能通过它的安全组引用另一个实例,因为它不是正确的组,亚马逊不允许更改安全组…
我可以select什么方式来允许本地交通从一个特定的IP地址在一个特定的IP地址在一个强大的方式?
首先,私有IP地址在重启后不会改变; 它们在一个实例停止之后改变,然后再次启动。 不同的东西。
您可以从任何EBS支持的实例创buildAMI。 在操作菜单下查找“创build图像”。 如果可以,请将AMI重新部署到专用安全组中,然后将该安全组ID用作辅助安全组中的源。 那么,你将不会有更改IP地址的问题。
如果您看不到“创build映像”选项,那么您有一个实例存储支持的实例。 这些是短暂的(即暂时的),所以当移动它们或复制它们时,您的select有限。
如果您打算长期使用服务器,则需要将其设置为EBS支持的实例,并将其部署在VPC中,而不是在Classic EC2中。
您可以将两个实例添加到一个安全组,并将此组指定为源,或指定此特定实例的安全组。 如AWS文档所述:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
One or the following options for the source (inbound rules) or destination (outbound rules): [skip] EC2-Classic: A security group for another AWS account in the same region (add the AWS account ID as a prefix; for example, 111122223333/sg-edcd9784) When you specify a security group as the source or destination for a rule, the rule affects all instances associated with the security group. For example, incoming traffic is allowed based on the private IP addresses of the instances that are associated with the source security group.
PS。 还有一种方法可以让安全组在一些停机的情况下进行更改:停止实例,使AMI,在新的SG中启动新的实例