Divide the following subnet 192.168.1.0/24 to support (2) sites with 60 hosts each, also assign an subnet to the serial port.
Step 1:
Figure out how many bits are required to support 60 hosts.
2n-2 ≥ 60, find n.
With the above chart we see that 26 is 64 which is greater than 60.
192.168.1.0, so we need to “steal” 6 bits and assign it to the host portion of the IP address. Lets convert 192.168.1.0 to binary to make this easier to see.
sub | host
192.168.1.0 = 192.168.1. 00 000000
Lets Reference the binary chart to figure out the subnet
Subnet 1
Subnet | host
192.168.1 00| 000000 = 192.168.1.0
Subnet 2
192.168.1. 01 | 000000 = 192.168.1.64
Subnet 3
192.168.1. 10 | 000000 = 192.168.1.128
Subnet 4
192.168.1. 11 | 000000 = 192.168.1.192
Here are assigned the subnets to their respective sites.
Subnet 1 is assigned to site 1
192.168.1.0/26
Subnet 2 assigned to site 2
192.168.1.64/26
Typically we will assigned IP address backwards. In this case the router is the last device on the network so it will be assigned the last IP address,
The switch is the second to last device on the network so we’ll assign it the second to last IP address.
Subnet 3 assigned to the serial ports
192.168.1.128/26
Site 1
Here we see host 1 is configured with the first IP address on subnet 1.
Site 2
Router 2 gets assigned the last host IP for subnet 192.168.1.64/26, which is 192.168.1.126 255.255.255.192
Next we will configure Router 2 to automatically assign IP addresses to hosts on the network.
First we start by naming out DHCP pool “NY”
Next we assign an IP address to the “NY” DHCP pool
The command do sh run will allow us to see the IP address assigned to the DHCP pool
Next we will configure a default router for our DHCP pool
Note in the real world we will usually use a DNS server for our default router
David Bombal set up a system to uncomment commands to configure the hosts, I’m unsure how this would look like in the real world, but here is a picture
It seems like he used auto eth0 and face eth0 inet dhcp
The next step is to exclude the routers address from the DHCP pool as we do not want our routers IP address to be allocated to a machine on the network automatically. As that may stop the router from working.
Here we can the CLI to exclude the routers address from the DHCP pool
Subnet 3
192.168.1.128 / 26
This subnet can support up to 62 hosts which is overkill. We only need to support two addresses.
Lets find out how many bits are necessary to support 2 hosts.
22-2 = 2, n=2.
Given n=2, means our host portion will be 2 bits long.
192.168.1. 1000 00| 00 = 192.168.1.128 / 30
192.168.1. 1000 0001 = 192.168.1.129/30 = S/0
192.168.1. 1000 | 0010 = 192.168.1.130/30 = S/1
192.168.1. 1000 | 0011 = 192.168.1.131/30
We’ll assign serial 1 & 2 with the two IP addresses in the middle.