Cisco DHCP Multiple Subnets

Sep 01, 2008 6 Replies

When on a Cisco router, configuring DHCP I assume that I can have multiple subnets although I have never seen an example at Cisco on this. Would I just have multiple "network" statements for those subnets?



Example



ip dhcp pool academy network 172.16.0.0 255.255.255.0 network 172.16.10.0 255.255.255.0 network 172.16.20.0 255.255.255.0


The reason that I ask is that for InterVLAN routing you end up with multiple subnets but I was never told how to manage DHCP for that situation and while it looks straightforward I do not know that the solution fits because I do not have equipment to try it on.



Thanks.


You would create different pools, ie pool_subnet1, then the gateway, dns yada yada, then pool_subnet2 with it's gateway etc.

-Brian

Ahhhhh....excellent. Good thing I asked! Thank you very much.

.

For those who have not seen the DHCP commands are are studying this, I thought that I would throw out the solution so you can see it according to what Brian explained.

For interVLAN communications according to Cisco you would configure:

Router_Two# config terminal Router_Two(config)# interface fa 0/1 Router_Two(config-if)# no shutdown Router_Two(config-if)# interface fa 0/1.1 Router_Two(config-if)# encapsulation dot1q 1 native Router_Two(config-if)# ip address 172.16.0.1 255.255.255.0 Router_Two(config-if)# interface fa 0/1.10 Router_Two(config-if)# encapsulation dot1q 10 Router_Two(config-if)# ip address 172.16.10.1 255.255.255.0 Router_Two(config-if)# interface fa 0/1.20 Router_Two(config-if)# encapsulation dot1q 20 Router_Two(config-if)# ip address 172.16.20.1 255.255.255.0 ... Router_Two# show ip interface brief FastEthernet 0/1 unassigned FastEthernet 0/1.1 172.16.0.1 FastEthernet 0/1.10 172.16.10.1 FastEthernet 0/1.20 172.16.20.1 Serial 0/1 unassigned ... and the DHCP solution would be: Router_Two(config)# service dhcp Router_Two(config)# ip dhcp pool native_VLAN Router_Two(dhcp-config)# network 172.16.0.0 255.255.255.0 Router_Two(dhcp-config)# default-router 172.16.0.1 Router_Two(dhcp-config)# dns-server 172.16.0.10 Router_Two(dhcp-config)# netbios-name-server 172.16.0.10 Router_Two(dhcp-config)# domain-name cisco.com Router_Two(dhcp-config)# lease infinite Router_Two(dhcp-config)# exit Router_Two(config)# ip dhcp pool accounting Router_Two(dhcp-config)# network 172.16.10.0 255.255.255.0 Router_Two(dhcp-config)# default-router 172.16.10.1 Router_Two(dhcp-config)# dns-server 172.16.10.10 Router_Two(dhcp-config)# netbios-name-server 172.16.10.10 Router_Two(dhcp-config)# domain-name cisco.com Router_Two(dhcp-config)# lease 0 24 0 Router_Two(dhcp-config)# exit Router_Two(config)# ip dhcp pool sales Router_Two(dhcp-config)# network 172.16.20.0 255.255.255.0 Router_Two(dhcp-config)# default-router 172.16.20.1 Router_Two(dhcp-config)# dns-server 172.16.20.10 Router_Two(dhcp-config)# netbios-name-server 172.16.20.10 Router_Two(dhcp-config)# domain-name cisco.com Router_Two(dhcp-config)# lease 0 24 0 Router_Two(dhcp-config)# exit

...

I have found a problem in what I wrote. I did not include multiple statements for the dhcp exclude.... do I need three statements or is there another way to do it?

Router_Two(config)# ip dhcp excluded-address 172.10.0.0 172.16.0.10 Router_Two(config)# ip dhcp excluded-address 172.16.10.0 172.16.10.10 Router_Two(config)# ip dhcp excluded-address 172.16.20.0 172.16.20.10

Thanks

You use all three statements.

----- Scott Perry Indianapolis, IN

-----

I have found a problem in what I wrote. I did not include multiple statements for the dhcp exclude.... do I need three statements or is there another way to do it?

Router_Two(config)# ip dhcp excluded-address 172.10.0.0 172.16.0.10 Router_Two(config)# ip dhcp excluded-address 172.16.10.0 172.16.10.10 Router_Two(config)# ip dhcp excluded-address 172.16.20.0 172.16.20.10

Thanks

Good to know just in case.

Thanks Scott!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required