0

I can't really understand why I'm getting overlapping addresses in subnets when they're between the allowed range.

I have the network 192.168.1.0/24, and I have to create 3 subnets:

A - 58 Hosts B - 28 Hosts C - 12 Hosts

Subnet A must be assigned to my R1 E0/0.10 sub interface, while B must be E0/0.20 and C to R2 E0/0

So I first created the subinterface .10 and .20 in R1 with

config t
int e0/0.10
encapsulation dot1q 10
int e0/0.20
encapsulation dot1q 20

Then I calculated the subnet A. If I need 58 hosts, then a 255.255.255.192/26 should be good. The ranges would be from 192.168.1.1 to 192.168.1.62

So I went ahead and added the address to my .10 subint

config t
int e0/0.10
ip add 192.168.1.1 255.255.255.192

And now I'm moving on to subnet B. 28 hosts, so the closest mask would be 255.255.255.224/27, with ranges 192.168.1.1 to 192.168.1.30

But if I try to add the address 192.168.1.2 255.255.255.224, I get the message "192.168.1.0 overlaps with Ethernet 0/0.10"

Why is it mentioning the original network address? How can I avoid this overlap then?

Dasph
  • 135
  • 4
  • 1
    They overlap because *they overlap*. 1-62 (0-63 or 0/26) is one network. 1-30 (0-32 or 0/27) overlaps that network. The next network starts at the end of the /26, so 64-254 (but not in one block -- the most it could be is 64/26 plus 128/25) – Ricky Jul 07 '21 at 01:05
  • So my calculation is wrong? Then what can I do to correct it? – Dasph Jul 07 '21 at 01:25
  • You can either correct the adress no to overlap, or use VRFs – manish ma Jul 07 '21 at 03:15
  • 1
    No. Your understanding of basic subnetting is wrong. (or more accurately, non-existent.) NE is not a place for people to get their homework questions answered. – Ricky Jul 07 '21 at 03:47
  • 1
    Quite frankly I don't care if you're using this site to get homework done or if your IT guy just quit and your boss made you do this because you were the closest thing to another one... The problem here is that you're subnetting the same network in 3 different ways from scratch, whereas you should carry on subnetting the subnet you just calculated (so to speak). I'll write the reply in a bit. – TheRedMetalRooster Jul 07 '21 at 04:09

1 Answers1

2

They're asking you to create 3 different subnets. You're overlapping because rather than carrying on from the 2nd subnet your first operation produced, you're just slicing the same initial net in smaller chunks, so of course they overlap, it's still the same network.

Your first operation produced 4 networks, 2nd one being 192.168.1.64,

Ideally, you'd want to elevate 2 to the Power of an x number where the result would be the amount of hosts you need. This isn't always possible though, so you can just go to the nearest (exceeding) amount. You need 28 for the 2nd subnet, so 2^5 = 32.

Now, take 32 (the amount of bits in an ipv4) and Substract the X (in this case, 5), the result is your mask in cidr notation, in this case 27 (so the first 27 out of 32 bits set to 1, meaning 255.255.255.224).

Take the last octet and substract it from 255. The result is your wildcard/backwards mask.

Subnet address last octet + wildcard = broadcast address.

For the first usable address in the range: subnet address + 1 on the last octet.

For the last one: -1 to the last octet in the broadcast address.

So in your case, your second subnet should be 192.168.1.64, and it's range of usable addresses for hosts should be from 65 to 94.

Do it for the third one. remember, start from 192.168.1.96