cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4615
Views
0
Helpful
5
Replies

Can't get DHCP server to give out correct subnet IP's.

berkshiremfp
Level 1
Level 1

Hi all,

I recently added a VLAN to my SG500X switch.  I have the devices communicating between the VLAN’s (using static IP’s).

I setup the new DHCP subnet on my Windows 2003 server but I can’t seem to get the DHCP server to hand out IP’s from the new subnet.

From what I understand, the Windows DHCP server is supposed to detect which VLAN the request is coming from and hand out the correct one.  If I plug a laptop into one of the untagged switch ports for the new VLAN I get an IP address...but it's from the original/primary subnet.

Do I need to configure anything else on the switch?  It seems to be handing out IP’s on the primary subnet/VLAN just fine.  I just need it to hand the correct one.

Any suggestions are appreciated.

Thanks,

Dan

5 Replies 5

Martin Carr
Level 4
Level 4

You need to create another SVI, it's subnet is then added to the request, as a result the respective scope is used.

Martin

Dan

 

We do not know what you have configured and that makes it difficult for us to give you good answers. Martin is assuming that you configured the layer 2 vlan but not the vlan interface. Perhaps that is the issue and perhaps it is something else. I wonder if you have commands in the new vlan that would forward the DHCP request from the vlan to the DHCP server. The symptoms suggest that the request is forwarded to the server using the source IP of the original vlan. I am not sure how that would work without seeing what you have configured. So if you can provide more details about the switch configuration then perhaps we can give better answers.

 

HTH

 

Rick

HTH

Rick

Everyone has provided you good info on what to look into so I will just try to give you some background info as this topic threw me for a loop back in the day when I was studying for my CCNA.  It never was really explained how the dhcp server knew which scope to assign from.  It works like this assuming the dhcp server is not inside the broadcast domain of the client.

1.Client with sends a DHCP request broadcast message

2.Access switch receives untagged frame from client with destination mac of FF:FF:FF:FF:FF:FF

3.Access switch encapsulates the packet into a frame that includes the vlan ID that was configured on the access port the client was connected to. Lets say vlan 10

4.Frame is forwarded out all interfaces in the same vlan or trunk interfaces except where it was received from

5.Your router receives the frame from the trunk port.  You either have an SVI or subinterface configured on the L3switch/router that is listening for traffic from that vlan.  That SVI/subinterface will have an IP address on it.  lets say 10.0.0.1/24.

SVI

int vlan 10

ip address 10.0.0.1 255.255.255.0

ip helper-address 192.168.1.50

Router

int f0/0.10

encapsulation dot1q 10

ip address 10.0.0.1 255.255.255.0

ip helper-address 192.168.1.50

6.Here is were the ip helper comes into play.  The router inserts the source IP of the SVI/subinterface for that vlan into the packet and sends it to the dhcp server. So 10.0.0.1 ->192.168.1.50

7.DHCP server receives and chooses the scope based on the source IP in the packet.  so in my example the dhcp server will look through it's configured scope and would find one for the 10.0.0.0/24 network.

8. DHCP server sends the dhcp offer to the IP of the SVI/subinterface which then forwards it on to the client.

 

Tom Watts
VIP Alumni
VIP Alumni

Hi Berk, you may need to configure DHCP relay on the switch, option 82. Assuming you have the VLAN interface with IP address created. Of the DHCP server won't use option 82... it would require routes.

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

mohabdel
Level 1
Level 1

Hi Dan,

 

I will give you example and you can recorrect it if you want ok. you must use Layer3!!!

I have two VLANs,  VLAN20 and VLAN30

VLAN20 IP address is 192.168.20.x

VLAN20 DHCP server IP IS 192.168.20.240

-----

VLAN30 IP address is 192.168.30.x

VLAN30 DHCP server IP IS 192.168.30.240

-----

I will go to CLI and config this vlan dhcp relay for each vlan dhcp server.  The easy way to access CLI with telnet.

login to switch GUI --> select Security --> TCP/UDP Services --> check Telnet Service --APPLY

download putty

http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

select telnet and type switch IP address

SG500# config t

SG500(config)# int vlan 20

SG500(config-if)# ip helper-address 192.168.20.240

SG500(config-if)# exit

SG500(config)# int vlan 30

SG500(config-if)# ip helper-address 192.168.30.240

SG500(config-if)# end

SG500(config)# wr mem

 

Thanks,

Moh

 

 

 

 

Review Cisco Networking products for a $25 gift card