Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Should IP address be unique across subnets in a VPC network ? can two subnets in a VPC network have the same IP range?

When i create subnets in my VPC, should each subnet have a unique IP range ? if the IP ranges are same, example,, then a VM created in each subnet may have IP. each subnet may have a VM with this same IP. when i ping by IP which VM is hit ?

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 : with a host 1 on

Subnet B : with a host 2 on

So when host 1 wants to talk to it ask dns where it is and gets an IP (today for me

host 1 looks at the subnet mask and sees if fits in its own sub net since 10.x.x.x and 216.x.x.x are not covered in the same subnet ( has IPs to in it) it puts packets to to the router for it to find the way to

Now if we have somehow peered Subnet A and Subnet B…. Host 1 wants to talk to it looks to see if is between (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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?