Good Evening,

I hope everyone is doing well this evening. Regarding the subject of subnetting in a LAN, please bear with me as I try to quantify the question in which I have. While the question did spawn from a homework assignment that I am attempting to complete for a project, it's not really the project per se but more of a query which spawned from the creation of a small network LAN diagram that I created which consists of a router, two switches, and two work stations for the assignment.

Assuming that the subnet on the router is, that will allow for 254 devices and the IP address of the router, or default gateway, is
Now lets assume there are three switches and each switch needs 30 IP addresses. The subnet mask on each of these switches can be configured to a mask of

My question is: how are the IP addresses split up?

Obviously, since the mask on the router only allows for 254 devices, we can't have more than that in total on the LAN. If we are giving 31 IP addresses to switch one, 31 IP addresses to switch two, and 31 IP addresses to switch three, do the need to be divided up in a certain way?
For example:
Switch 1: contains through
Switch 2: contains through
Switch 3: contains through

Do the IP addresses need to be configured in a specific way such as the example above? If not, what's the best practice when configuring a network in this fashion?

Ken Swartz

How are you going to assign subnets to the Layer 2 switches? If they are layer 3 switches, then keep the /24 subnet on the router and connected switchports, then assign any subnet you want behind each of the 3 switches.


I'm not sure I understand your question. The router would receive 254 usable IP addresses. The subnet on the router is The router then assigns a subnet of on G0/1, a subnet of on G0/2, and a subnet of on G0/3 effectivly giving each switch 30 IP addresses to play with.

I'm just not certain which IP addresses the switches each get or if it even matters.

Specifically, this is the command used to assign subnets to a layer 2 switch from the router Gigabit Ethernet:

R1 (config) #interface gigabitethernet 0/1
R1 (config-if) #ip address
R1 (config-if) #exit
R1 (config) #interface gigibitethernet 0/2
R1 (config-if) #ip address
R1 (config-if) #exit
R1 (config) #interface gigibitethernet 0/2
R1 (config-if) #ip address

I may have just answered my own question here in looking up the above commands.