Dhcp on a per vlan basis?

Unanswered Question
Oct 3rd, 2008
User Badges:

Hello fellow Císco-fans


Is it possible, on a 3560, to estblish dhcp on a pr vlan basis? (if i have 8 vlan'son a switch, can i have 8 instances of a dhcp server running?)

If it is in deed possible - how is it configured?


Best rgds

/Jan - Denmark

(CCNA, stud ccnp,)

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (2 ratings)
Loading.
Giuseppe Larosa Fri, 10/03/2008 - 23:34
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Jan,

you can and actually should configure a DHCP scope for each Vlan/IP subnet but this doesn't mean you are running 8 DHCP servers instances but rather that the single DHCP server has a database that contains 8 different DHCP scopes.


See the following example:


!

ip dhcp excluded-address 10.110.224.129 10.110.224.132

ip dhcp excluded-address 10.110.224.145

!

ip dhcp pool DATI

network 10.110.224.128 255.255.255.240

default-router 10.110.224.129

dns-server 10.98.112.32 10.55.0.32

netbios-name-server 10.52.64.37 10.24.128.151

lease 0 1

!

ip dhcp pool VOICE

network 10.110.224.144 255.255.255.248

default-router 10.110.224.145

dns-server 10.98.112.32 10.55.0.32

netbios-name-server 10.52.64.37 10.24.128.151

option 150 ip 10.98.67.5 10.55.61.4

lease 0 1

!


Here two pools, two DHCP scopes have been defined but the server running is only one.


Hope to help

Giuseppe



towli Sun, 10/05/2008 - 14:07
User Badges:

Thank you !

Your help is much appreciated!

I hope to be able to be of assistance to this forum sometime in the future (when i grow hardcore :) )


Best rgds. from Denmark

/Jan

Giuseppe Larosa Sun, 10/05/2008 - 22:15
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Jan,

thanks for your kind remarks.


You are encouraged to participate in the forums and the path you hope for you is actually the one each of us is following.


Best Regards

Giuseppe


towli Sun, 10/05/2008 - 23:13
User Badges:

Hello again


As i study the above config for implementation on my lab network, it occurs to me - how do i "mount" the different scopes to different vlans? How would the dhcp server instance on the switch know which scope to pick from?


Best rgds

/Jan

Giuseppe Larosa Mon, 10/06/2008 - 05:48
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Jan,

DHCP procotol client requests uses IP packets with a broadcast destination.

The packet is received by the switch that will insert its own ip address on receiving interface in the gateway field in the DHCP request packet.

Then, if the DHCP is running on the switch all info needed for looking in the correct scope is ready.

If using an external DHCP server a further step is needed and is the ip helper address.

IP broadcast packets cannot be routed so on the vlan inteface the reeceiving interface you can set the ip helper address where you specify the unicast ip address of the DHCP server.

This info is used to modify the DHCP request: the ip destination is changed from 255.255.255.255 to DHCP_server_ip and the GW field is set to L3 rx interface'ip address


The DHCP server will be able to look at the right scope and will send back its answer to the router's interface . The router will send out the answer to the client PC MAC address.


example


int vlan 130

ip address 10.110.130.1 255.255.255.0

ip helper-address 10.80.10.1

...

!


10.80.10.1 is the DHCP server.


Hope to help

Giuseppe


towli Mon, 10/06/2008 - 05:51
User Badges:

Hello again


I figured it out today, to my boss' satisfaction! I thank you very much once again!


/Jan


(Cisco rules :) )


Actions

This Discussion