Configure Windows DHCP for Cisco Switch Vlans

In most environments nowadays, they use VLANs on Switches.
I would like to know, after creating VLANs , then on Windows DHCP I want to create Scopes for each VLAN. How do DHCP Scopes Map to VLANs, i mean if a workstation is automatically assigned IP 192.168.15.70/24, but the Network cable that connect the workstation to the switch port is going to a port in VLAN 20. I want the third octet of the  IP of the workstation to match the VLAN number. in the Example above the workstation should be connected to Vlan 15

Any help will be very much appreciated.

Thank you
jskfanAsked:
Who is Participating?
 
Craig BeckConnect With a Mentor Commented:
No.  If the DHCP request passes through a router via the IP helper command the address of the router's interface is added to the packet in the giaddr field.

That tells the DHCP server which scope is required.

If no giaddr is present in the DHCP packet the server issues an address from the scope which matches the IP range on the DHCP server interface that the packet was received on.
0
 
Craig BeckConnect With a Mentor Commented:
You can create VLAN 20 and configure the IP subnet for that VLAN as 192.168.20.0/24 for example.  That's straight-forward.  Try not to think about DHCP scopes mapping to VLANs - they don't.  All that happens to determine which scope an IP should be allocated from is that the DHCP server checks the value of the giaddr field inside the DHCP request packet and checks to see if it has a scope on the same subnet.  If a scope is present it assigns an address, and if a scope doesn't exist the client gets no address from that server.  If the giaddr field is blank or not present the DHCP server assigns the IP address from the same scope that it's NIC is on.

To put it simply, if your DHCP server has one NIC don't worry about what's going on at your switch.  You would just create scopes for the subnets you have configured.  The only thing that is important is that the DHCP server has a route to each subnet you're assigning an IP address to.

You can also put a dedicated NIC from the DHCP server in each VLAN, but that's not always practical, especially if you have lots of subnets.
0
 
jskfanAuthor Commented:
When you plug a workstation into a port in VLAN 20, does that workstation tell DHCP that I am in VLAN 20 and please give me IP address from the scope 192.168.20.0 ?

I am not familiar with giaddr field..
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Hassan BesherConnect With a Mentor Commented:
it depends upon your routing method, if you are using L3 switch you will use IP helper command under vlan interface , if you are using Router on stick design you will have to put IP helper command under router subinterface.

simply IP helper command  will convert DHCP broadcast discover packet into unicast towards your DHCP server and your DHCP server will choose which scoop based upon the source ip address range the request came from.
0
 
jskfanAuthor Commented:
OK… IP helper address is the one that knows from which VLAN the client request is coming from and add the info of the VLAN to giaddr field, then windows DHCP server reads giaddr and determine which appropriate scope will hand out IP address from back to the client…

in the case I have  one switch in the LAB with one VLAN only , but multiple DHCP scopes on the windows server , there is no need for IP helper address… in this scenario I believe DHCP server will not hand out and IP address from any scope except if there is one on the same subnet as DHCP server itself is on…….. I could be wrong ???
0
 
jskfanAuthor Commented:
Thank you Guys!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.