cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14489
Views
4
Helpful
2
Replies

DHCP Server in Cisco L3 Switch

OK I have a Cisco 4500 switch that I have created a DHCP pool on and it works but Im wondering how it works. The only reason I did it correctly is because I followed a Cisco command book.

Hers is what I have: Note names and IP's are changed for obvious reasons.

ip dhcp excluded-address 192.168.1.0 192.168.1.100

ip dhcp pool MyPool

network 192.168.1.0 255.255.255.0

default-router 192.168.1.1

lease infinite

service dhcp

Note: I did not configure any DNS server or net-BIOS name server because just the PC's connected to the switch need to communicate with eachother and instead of making them static I created this pool. The switch is isolated so the netowork traffic wont go anywhere.

I also configured:

interface VLAN 1

no shut

ip address 192.168.1.1 255.255.255.0

exit

My Questions:

1.) Does the SVI have to have an IP address and does the default-router have to be the SVI address. If so why or why not?

2.) Can I assign the DHCP pool to a specific VLAN or is that chosen when the SVI is turned on and configured based on the "netowk" I put in?

3.) If I were to connect the switch to my working network with a DHCP server on the network will the PC go for that or get interrupted by the switch the PC is connected to and take an IP address from that pool? Note: The "Core switch of my network also has a default gateway on it's VLAN 1 SVI of 192.168.1.2.

Like I said IP addresses, VLAN's and names have been changed as to not diclose information about my network.

Any help would be appreciated.

Thanks.

2 Replies 2

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello David,

1)  when the DHCP clients need to reach outside world ( not in your case) the default gateway may be provided or by another device ( an external router) or by an SVI. So having the SVI IP address =  DHCP default-router of th DHCP pool is quite common. If multiple network device are serving the clients the default-router is equal to the virtual IP address VIP of an HSRP or VRRP ( or GLBP) group

2) No, there is no a direct way to associate the DHCP pool that is an OSI layer3 concept to a broadcast domain or Vlan that is an OSI layer 2 concept as you noted the Vlan is associated to the SVI and the SVI IP address is used to point to the appropriate DHCP pool.

3)  what exactly happens depends on configuration: the DHCP request message sent by clients is sent to address broadcast 255.255.255.255 and cannot be routed to another IP subnet. It can be converted by using the

ip helper-address

command under the SVI interface. This enables the DHCP relay function and allows to convert the unroutable DHCP requests in routable packets with a destination that is the IP address of the remote DHCP server. The DHCP relay agent network device populates an internal field with the IP address of the SVI on which the original DHCP request has been received (GI address). In this way the remote DHCP server can use this info to pick up a free IP address ( if any) from the appropriate DHCP pool.  The DHCP server answers to the DHCP relay agent that can send out the DHCP offer ( containing the assigned IP address)  to the client.

With your current configuration users are served by local DHCP server service running on the switch and no DHCP request is propagated to remote DHCP server.

Hope to help

Giuseppe

Thanks for the input. This helped me out a lot.

Sent from Cisco Technical Support iPhone App

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card