I have a question about using IP Helper for DHCP. There are alot of other posts on this subject, so I tried to find somewhere that my question might already be answered but it wasn't there.
Allright, I have a 3750 switch doing ip routing. On vlan1, I have a dhcp server at 192.168.1.7. That DHCP Server is running two dhcp scopes. One for the 192.168.1.0/24 and one for 192.168.2.0/24. The switch is configured as such:
interface vlan 1
ip address 192.168.1.1 255.255.255.0
interface vlan 2
ip helper 192.168.1.7
However, when I connect a dhcp client on vlan 2, it gets an address from the 192.168.1.0 subnet. we verified that both scopes are running and we verified that we are connecting to the right vlan. However, we still get the wrong address.
1. Any ideas on what could cause this? I know it might come down to the server and I am concurrently investigating the issue form the server side. But, any brainstorming on the switch side would be helpful.
2. How does the server know which scope to assign addresses out of? I have done this in other enviornments and didn't have to do anything in particular to the server. I assumed that the layer 3 switch is tagging the packet in some way that indicates to the server that it should belong to the 192.168.2.0 network.
3. What is the role of the dhcp smart-relay? that is not configured here, should we be looking at it?
4. does this configuration qualify as a relay agent that conforms to RFC 1542?
As Raj rightly pointed out, the SVI interface will forward the broadcast DHCP request from the client as a unicast message directed at the helper address, using its own address as the source IP. This is is how the DHCP server knows from which subnet to issue an IP address. So, it seems as though there is a misconfiguration on your DHCP server.
Moreover, is this a prodcution switch or just a lab set up? Im asking because it is not a good practice to use VLAN 1 as a client VLAN because the switch forwards management frames over VLAN 1 - CDP, VTP, etc...You should keep all user traffic off of VLAN 1.
Lastly, the recomenndation that you remove the helper address configuration line from interface vlan 2 to test DHCP does not make sense. As you rightly pointed out, the router needs the correct configuration lines to forward the DHCP requests to the DHCP server, otherwise the client's broadcast will never be propagated passed the router interface..