Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Dhcp on a per vlan basis?

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,)

7 REPLIES
Hall of Fame Super Silver

Re: Dhcp on a per vlan basis?

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

New Member

Re: Dhcp on a per vlan basis?

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

Re: Dhcp on a per vlan basis?

Hi Jan,

Have a look at this excillent link from TCPMAG -

http://tcpmag.com/qanda/article.asp?EditorialsID=285

This explains how actually it works.

-> Sushil

Hall of Fame Super Silver

Re: Dhcp on a per vlan basis?

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

New Member

Re: Dhcp on a per vlan basis?

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

Hall of Fame Super Silver

Re: Dhcp on a per vlan basis?

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

New Member

Re: Dhcp on a per vlan basis?

Hello again

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

/Jan

(Cisco rules :) )

3633
Views
8
Helpful
7
Replies
CreatePlease to create content