1

I'm trying to understand if it is possible to have a router (as shown in the below diagram) provide DHCP leases to more than one subnet if the subnets are not directly attached.

Simple network diagram showing router, upstream switch and two additional upstream switches in 192.168.x.x subnets

If both the printers and the PC's were part of the same subnet, then it would be straightforward to have the router interface provide DHCP to all of the devices. However, I'm not sure what the best way to have multiple network segments will be then. Especially if I scale this example up to hundreds of machines.

Would a better solution potentially be to remove switch6 and have a router that supports as many subnets as I wish to connect?

Could VLAN's help in some capacity?

Is there any other good solution to having a single device provide DHCP scopes for multiple subnets that are not directly conneted?

Edit: Please disregard the model numbers of the switches/routers and treat them as generic 'devices'. I did not intend on specifying a specific model when quickly building this diagram in packet tracer.

0

4 Answers 4

3

Understand that the DHCP servers in routers are pretty crude, and a business should have a real DHCP server. In any case, you can configure multiple DHCP scopes on a router.

If the networks to be served are not directly connected to the DHCP server (including a DHCP server configured on a router), you can configure a DHCP relay on the device (router or layer-3 switch) where the networks terminate.

In your diagram, if the networks are not directly connected to the router, then Switch 6 is a layer-3 switch (router) terminating the networks. On the layer-3 interfaces for each network (physical or SVI), you would use the ip helper-address command to create the DHCP relay pointing to the router running the DHCP server.

You could also run the DHCP server on the layer-3 switch, or you could have a real DHCP server on only one of the networks and use the DHCP relay for all the other networks.

3
  • I think the 2960 are L2 only.
    – Zac67
    Jun 13, 2022 at 4:39
  • 1
    Then the question is incorrect in that the networks do reach the router.
    – Ron Maupin
    Jun 13, 2022 at 12:09
  • I apologise, I just slapped switches from Packet Tracer into the diagram without giving the specific models in use thought.
    – NULLZ
    Jun 13, 2022 at 15:51
3

Absolutely. Yes. In terms of Cisco brand routers, there is no maximum hard limit that I know of. If the DHCP server is on a remote subnet, you get the DHCP requests to the DHCP server via ip helper address commands. In the diagram you posted, the layer 3 gateway, or router, is in fact directly connected via layer 2 to all subnets as Switch 6 looks like a layer 2 device meaning that you probably don't even need the helper address configured.

ip dhcp pool 0
 network 172.16.0.0 /16
 domain-name cisco.com
 dns-server 172.16.1.102 172.16.2.102
 netbios-name-server 172.16.1.103 172.16.2.103 
 netbios-node-type h-node
!
ip dhcp pool 1
 network 172.16.1.0 /24
 default-router 172.16.1.100 172.16.1.101 
 lease 30 
!
ip dhcp pool 2
 network 172.16.2.0 /24
 default-router 172.16.2.100 172.16.2.101 
 lease 30
1

is it possible to have a router (as shown in the below diagram) provide DHCP leases to more than one subnet if the subnets are not directly attached?

Yes, if you can use DHCP relay: ip helper-address on an attached switch, and relay support on the DHCP server. As Ron's already pointed out, a DHCP server on a router or switch may be somewhat rudimentary and you might want a more full-fledged server.

However, I'm not sure what the best way to have multiple network segments will be then. Especially if I scale this example up to hundreds of machines.

The standard solution is using VLANs, one for each IP subnet, so they are separated on the data link layer. To re-enable communication between subnets/VLANs you need to attach them to a router or a layer-3 switch.

Would a better solution potentially be to remove switch6 and have a router that supports as many subnets as I wish to connect?

You don't need to remove Switch6. Since Router0 is currently the only router in that network, you'd need to connect each VLAN to it. For that, you use a VLAN trunk port between (at least) Switch6 and Router0.

You can enable both PC and Printer VLANs on either access switch - then you'd also trunk those VLANs to Switch6.

However, the 2911 is a likely bottleneck for all but small-to-moderate inter-VLAN traffic. For a larger scale, you'd add a layer-3 switch for internal routing between VLANs and use the 2911 for WAN routing only.

1

Alternately, deploy a layer 3 switch in place of switch6 and configure SVIs in the L3 switch with DHCP configuration. This scenario will be good practise when DHCP configuration has multiple subnets. A router can be used for WAN connectivity, connecting to an ISP. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.