1

I am currently getting my hands dirty with AWS VPC and have stumbled upon a scenario in peering.

I had created two VPCs - VPC1, VPC2. VPC1 has a public subnet and an EC2 Linux instance. VPC2 has a private subnet and an EC2 Linux instance.

I have established peering between the two VPCs and was able to access the EC2 instance on VPC1 from my local machine and then connect to EC2 instance on VPC2 from it.

I had a rule on security group of the EC2 instance on the private subnet to allow ALL SSH connectivity to it. ( without this I wasn't able to connect between the instances )

Now instead of having the second instance on a private subnet, I modified the subnet to be a public one and am able to connect to the EC2 instance on it from an EC2 instance on non-peer VPC as well.

My question :

  1. How is that am able to connect to public subnets between non-peered connections? Can I decipher that public subnets in the same region don't require peer connections setup in order to connect?
4

1 回答 1

1

公有子网EC2的公有 IP可从其 NACL 和安全组允许的任何地方访问。如果这些允许互联网范围内的访问,则包括 AWS 中的任何内容。如果您想从另一个 VPC 连接到 EC2 的私有 IP,则需要对等。

于 2017-12-27T22:48:48.317 回答