A little subnetting challenge for today! Time to brush off the weekend cobwebs, put the hangover to one side and exercise the grey matter!

This one is all about address space restrictions and conservation of IPs.

### Network topology:

### Task:

Using the network 10.50.1.0, with the smallest (but usable) network mask, set up IP addressing on all the nodes, and make sure that one node can ping its neighbor. If you want to confirm end to end connectivity through an IGP, then go ahead!Click here to download the UNL file from the forum.

### Solution:

**Subnet:**

We need to use a /27 subnet here (255.255.225.224). But why?

A /27 subnet will give us 32 addresses. Less the subnet and broadcast address, this leaves us with 30 usable host addresses. A /28 would not give us enough addresses, and a /26 would give us too many.

We can work out the number of addresses we need by counting the number of links in the network that require IP addresses (16), and work out the subnet as follows.

On a piece of paper, write out the octet numbers:

**128 64 32 16 8 4 2 1**

Then start adding the numbers from the right to the left, until we get to a place that gives us enough addresses:

1+2 = 3 (not enough)

1+2+4 = 7 (not enough)

1+2+4+8 = 15 (not enough)

1+2+4+8+16 = 31 (perfect!)

Then take this number away from 255, to give us the subnet mask:

255-31=224

We now have our subnet mask of 255.255.255.224!

**Addressing:**

We cannot just start addressing the interfaces using this subnet though, as we cannot have two interfaces with overlapping subnets. Instead we need to further sub-divide our subnet into four groups. We need to address R1 to R2, R2 to R3 and R4, and the office network.

R1 to R2 will need a point-to-point link (a /31), as will R2 to R3 and R2 to R4.

We use /31 subnet masks (255.255.255.254) as these give us just two addresses, which is ideal. Therefore we can number the links as follows:

R1 (e0/0): 10.50.1.2 - R2 (e0/0): 10.50.1.3

R2 (e0/1): 10.50.1.4 - R3 (e0/0): 10.50.1.5

R2 (e0/2): 10.50.1.6 - R4 (e0/0): 10.50.1.7

Notice that I have started R1 with an IP address of 10.50.1.2. We cannot number R1 with 10.50.1.1, and R2 with 10.50.1.2, as these are in different subnets. We could have used 10.50.1.0 an 10.50.1.1, but I don't really like numbering hosts with an IP address with .0 (though it is valid).

The office will use a larger subnet masks

There are 10 interfaces here, so using the same method as above, we need to borrow the first four octets, which will give us 15 addresses (/28), so the subnet for this will be 255-15, which gives us a subnet mask of 255.255.255.240. We cannot start from where the first set ends though, as there will be an overlap. This is why it makes sense to work out the largest section first. Nevertheless, let's work out where we need to start from, it makes for good practice.

With a subnet mask of 255.255.255.224, we can have two /28 subnets, each with 16 addresses in them (14 of which as usable). The first will start at 10.50.1.0, and end at 10.50.1.15, and the second will start at 10.50.1.16 and end at 10.50.1.31. So, we cannot start numbering our office network at 10.50.1.7, as this will overlap into the subnet configured for the other network. Remember that we lose the first and last address to the subnet and broadcast addresses.

So we can start numbering as follows:

R3 (e0/1): 10.50.1.17

R4 (e0/1): 10.50.1.18

R5 (e0/0): 10.50.1.19

R6 (e0/0): 10.50.1.20

R7 (e0/0): 10.50.1.21

R8 (e0/0): 10.50.1.22

R9 (e0/0): 10.50.1.23

R10 (e0/0): 10.50.1.24

R11 (e0/0): 10.50.1.25

R12 (e0/0): 10.50.1.26

If we add an IGP into the mix, then we can get from one side to the other:

R1#sh ip route eigrp | b Gate Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 5 subnets, 3 masks D 10.50.1.4/31 [90/307200] via 10.50.1.3, 00:01:55, Ethernet0/0 D 10.50.1.6/31 [90/307200] via 10.50.1.3, 00:01:55, Ethernet0/0 D 10.50.1.16/28 [90/332800] via 10.50.1.3, 00:01:55, Ethernet0/0 R1#ping 10.50.1.26 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.50.1.26, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms R1#

How did you get on?