2 Answers
Hi there,
Yes, each subnet would need to be unique within a VPC. Otherwise you get an error when trying to create a new subnet with an existing CIDR block.
To add on to T.J.’s answer above. If you could add the same subnet again routing would not work correctly. I’ll do a quick example to help explain it.
Subnet A : 10.1.1.0/24. with a host 1 on 10.1.1.30
Subnet B : 10.1.1.0/24 with a host 2 on 10.1.1.60
So when host 1 wants to talk to google.com it ask dns where it is and gets an IP (today for me 216.58.192.142)
host 1 looks at the subnet mask and sees if 216.58.192.142 fits in its own sub net since 10.x.x.x and 216.x.x.x are not covered in the same subnet (10.1.1.0/24 has IPs 10.1.1.1 to 10.1.1.255 in it) it puts packets to 216.58.192.142 to the router for it to find the way to 216.58.192.142.
Now if we have somehow peered Subnet A and Subnet B…. Host 1 wants to talk to 10.1.1.60 it looks to see if 10.1.1.60 is between 10.1.1.1-10.1.1.255 (as defined by the Subnet mask) and sees that it is so it sends a packet to the local network and not to the routers. As they can only talk via routers this fails.
The short story is it is blocked because routing between them will not work correctly. In large enterprise environments where you have private (1918 space) networks on premise may want to have VPN or highbandwith links to the on prem environs you can still have issues with this.