configure multiple dhcp pools on switch for multiple VLANs

Unanswered Question
Mar 10th, 2010
User Badges:

Is it possible to have multiple dhcp pools for multiple VLANs? The switch is a 6509 and/or 4506 catalyst. I don't want to use server-based products. Thanks in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Ganesh Hariharan Wed, 03/10/2010 - 08:00
User Badges:
  • Purple, 4500 points or more
  • Community Spotlight Award,

    Member's Choice, February 2016

Is it possible to have multiple dhcp pools for multiple VLANs? The
switch is a 6509 and/or 4506 catalyst. I don't want to use server-based
products. Thanks in advance.

You can check out the below link for configuration details:-


http://www.cisco.com/en/US/docs/ios/12_1/iproute/configuration/guide/1cddhcp.html#wp1000999


Hope to Help !!


Ganesh.H

Reza Sharifi Wed, 03/10/2010 - 08:09
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 LAN

Hi Harris,


Here is a sample config from a 3750 with multiple pools and multiple helper-addresses The same commands should be used on 6500 or 4500.



Switch-B(config)#do sh run | i dhcp
ip dhcp pool 20.20.20.0
ip dhcp pool 30.30.30.0
Switch-B(config)#do sh run int vlan 10
Building configuration...

Current configuration : 121 bytes
!
interface Vlan10
ip address 10.10.10.1 255.255.255.0
ip helper-address 20.20.20.1
ip helper-address 30.30.30.1
end

Switch-B(config)#


HTH

Reza

Mohamed Sobair Thu, 05/20/2010 - 10:28
User Badges:
  • Gold, 750 points or more

Hi,


You can of course have multiple DHCP pools for multiple Vlans.



HTH

Mohamed

hooperp Thu, 12/01/2011 - 08:12
User Badges:

Hello,


I am also attempting to do the same configuration as above except all of the Subinterfaces are in the same VRF.  When I try to create multiple pools I receive the following error:


"% VRF USERNET is associated with pool DHCP-POOL1"


From what Ive been reading you can only have 1 DHCP Pool per VRF.  Is there any way around this?


Thanks.

greenglyph Thu, 05/20/2010 - 10:12
User Badges:

On our router, we do it like this (I'm not sure this applies to IOS switches, but it does work on our router):


  1. create subinterfaces configured with VLANs and IP addresses
  2. create DHCP pools with networks that contain the IP addresses of the VLAN subinterfaces



The router will then assign DHCP clients their addresses based on the interface VLAN/network that the request was recieved on


Here are some config snippets:


The interfaces (Step 1)



interface GigabitEthernet0/0                                                   

no ip address                                                                 

duplex auto                                                                   

speed auto                                                                    

!                                                                              

interface GigabitEthernet0/0.1                                                                                       

encapsulation dot1Q 1 native                                                         

ip address 192.168.1.254 255.255.255.0                                        

!                                                                              

interface GigabitEthernet0/0.2                                                                                        

encapsulation dot1Q 2                                               

ip address 192.168.2.254 255.255.255.0                                       

!                                                                              

interface GigabitEthernet0/0.3                                                                                        

encapsulation dot1Q 3                                                        

ip address 192.168.3.254 255.255.255.0


and here are the DHCP pools (Step 2)



ip dhcp pool Pool1                                                  

   network 192.168.1.0 255.255.255.0

   domain-name DOMAIN.COM                                                                                    

   dns-server 192.168.1.10                                                 

   default-router 192.168.1.254  


ip dhcp pool Pool2                                                
   network 192.168.2.0 255.255.255.0                                           
   domain-name DOMAIN.COM                                       
   dns-server 192.168.1.10                                                     
   default-router 192.168.2.254

ip dhcp pool Pool3                                               
   network 192.168.3.0 255.255.255.0                                           
   domain-name DOMAIN.COM                                       
   dns-server 192.168.1.10                                                     
   default-router 192.168.3.254
 
So, if a request comes in on VLAN 3, it will be handled by GigabitEthernet0/0.3, which has an IP of 192.168.3.254, on network 192.168.3.0, which is used in DHCP Pool3. So, the client will then be assigned an IP address from Pool3.
 
This should also work for entirely seperate interfaces, as opposed to subinterfaces.
Hope that helps.

Actions

This Discussion