[英]Add a Security Group to the Inbound Rule of another Security Group as a Source with Terraform (AWS)
[英]Source and destination ports are different, so which port number i need to mention in inbound aws security group
在 aws 入站/出站安全组天气的端口范围选项中,我们需要提及 sourceip 端口或 destinationip 端口。
Q1:例如,在这种情况下,PROD 尝试在网关入站安全组天气中连接 GATEWAY,我需要在端口范围列中提及 PROD 端口或 GATEWAY 端口。 作为回报,GATEWAY 正在尝试连接 PROD,然后在 Gateway 出站安全组天气中,我需要在端口范围内提及 PROD 端口或 GATEWAY 端口。
定义规则时,使用与目标关联的端口号。 例如:
Laptop
连接到EC2-Instance
EC2-Instance
上的安全组允许端口 80 上的入站连接哪个端口用作Laptop
上的“源”端口并不重要。 安全组只看目的端口。
另一个例子:
EC2-Instance
连接到 Inte.net 上的www.example.com
EC2-Instance
上的安全组允许端口 80 上的出站连接哪个端口用作EC2-Instance
上的“源”端口并不重要。
AWS 虚拟私有云 (VPC) 中的安全组是有状态的。 这意味着如果流量被允许“进入”,那么它也被允许“离开”。 因此不需要仅仅为了响应传入连接而定义出站规则。 纯粹由于入站规则接受传入流量而自动允许响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.