Monday, June 20, 2011

Implementing DHCP in a Multilayer Switch


By default, Catalyst multilayer switches include DHCP relay agent software.
Distribution multilayer switches often act as layer 3 gateways for clients connecting to the access switches.  Because of this DHCP can be provided within the same switches to serve the hosts with IP addresses and other necessary network parameters.
The other option is to consolidate the DHCP services to one or more dedicated servers.  In that case, the distribution layer must redirect incoming client DHCP requests to the external DHCP server.

Configuring DHCP service on the multilayer switch

1.  By default the switch assumes the whole network range for the DHCP scope.  To exclude certain addresses or ranges, in global config mode, use theip dhcp excluded-address command.  Follow it with a range of addresses to exclude from your scope.  For discontinuous ranges, use more than one ip dhcp excluded-address commands.
2.  Configure the network value, which indicates the subnet to offer addresses from.
3.  Configure any other network parameters you would like the switch to server in its DHCP offers (ex. default-gateway, lease duration, subnetmask, DNS server address).
Note:  Remember that a switch cannot offer DHCP addresses for a subnet it is not a member of.
Configuration Example
Switch(config)# ip dhcp excluded-address (range beginning to end)
Switch(config)# ip dhcp pool example10
Switch(config-dhcp)# network
Switch(config-dhcp)# default-router
Switch(config-dhcp)# option 150 (Option 15- specifies a TFTP server IP – often for IP phones to reach Call Managers)
Switch(config-dhcp)# lease 0 8 0 (0 days 8 hours 0 minutes)Switch(config)# interface vlan10
Switch(config-if)# ip address

Configuring DHCP Relay

If an enterprise is using external DHCP servers, then the ip helper-addresscommand must be entered on the layer 3 interface.  Because hosts use broadcast messages to try to find the DHCP server, if it is in a different subnet, it will be dropped at the default gateway because broadcasts are not forwarded across VLAN boundaries.
The DHCP relay agent allows the DHCP request to be forwarded on as a unicast message to a single IP address.  It not only forwards DHCP services, but also TFTP, DNS, Time, NetBIOS, names server, and BOOTP packets by default.  The ip helper-address command must be applied to the layer 3 interface itself.
Configuration Example
switch(config)# interface vlan10
switch(config-if)# ip address
switch(config-if)# ip helper-address
Note:  You can apply to to an SVI or a routed interface.

Verifying DHCP Settings

Use these two commands to check its operation:
Switch# show ip dhcp binding – displays client DHCP bindings including IP address and MAC
Switch# debug ip dhcp server packet- shows in real-time the DHCP discover, offer, reply, and ack packets

No comments:

Post a Comment

Dear Reader, if you like My Blog content, feel free to comment on our blog posts.