-2

This question is for AWS Engineers. I was reading about AWS VPC. It says VPC peering allows to connect 1 subnet to another subnet inside another VPC. Also it says, Instances on both subnet work as if they were in 1 subnet. So the question comes, "what happens if the IPs on both instances were identical?" Are they going to conflict? If not, how can I distinguish which one is which?

Thank you

  • 1
    Where did you read this? It is incorrectly worded, and would not have come from official AWS documentation. – John Rotenstein Dec 27 '17 at 06:44
  • This is original documentation which is herehttp://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/Welcome.html – Farrukh Sadykov Dec 27 '17 at 06:48
  • That page talks about networks, not subnets. – John Rotenstein Dec 27 '17 at 06:50
  • Can 2 networks on different VPCs have identical IPs? It also says, I can peer connect to VPC on someone else account. Can that person have same IP as mine? – Farrukh Sadykov Dec 27 '17 at 06:52
  • No. Answer updated with more details. – John Rotenstein Dec 27 '17 at 06:54
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Web Applications Stack Exchange](http://webapps.stackexchange.com/), [Webmaster Stack Exchange](http://webmasters.stackexchange.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Dec 27 '17 at 13:08

1 Answers1

3

This is an inaccurate description.

From VPC Peering:

A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them privately. Instances in either VPC can communicate with each other as if they are within the same network. You can create a VPC peering connection between your own VPCs, with a VPC in another AWS account, or with a VPC in a different AWS Region.

VPC Peering is a connection between two VPCs (not two Subnets). One of the rules for VPC peering is that the IP address ranges of the two VPCs cannot overlap. Thus, the situation described in the question cannot eventuate.

From Invalid VPC Peering Connection Configurations:

You cannot create a VPC peering connection between VPCs with matching or overlapping IPv4 CIDR blocks.

If the VPCs have multiple IPv4 CIDR blocks, you cannot create a VPC peering connection if any of the CIDR blocks overlap (regardless of whether you intend to use the VPC peering connection for communication between the non-overlapping CIDR blocks only).

Once a VPC Peering connection is established, the Route Tables need to be modified to route traffic across the VPC Peering connection. It is possible to modify only the route tables for a specific subnet, so this could be considered to be peering just a single subnet, but it would need to be specifically configured this way. (It is actually a common use-case, so that only a single subnet in each VPC is peered, acting as a type of DMZ for added security.)

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470