cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
91
Views
1
Helpful
5
Replies

The "ip dhcp-server" command -What is it?

modular182
Level 1
Level 1

Someone I'm working with has a new Catalyst 9500 switch. On it he has the following config:

boot system bootflash:packages.conf
boot system usbflash0:cat9k_iosxe.17.09.05.SPA.bin
!
ip dhcp-server 10.0.40.9
ip dhcp-server 10.10.6.211
ip dhcp relay information trust-all
!

What the heck is the "ip dhcp-server x.x.x.x" command? I know what a dchp helper IP does, but that's configured under an interface. He has no other DCHP configuration on his switch and his problem is that nothing on this switch can get a DHCP IP address from a Windows server that's also connected to the switch. Portfast is configured on all of the access ports. I've googled and searched through the catalyst commend reference for this "ip dhcp-server x.x.x.x" command and I can't find any info on it. Does anyone know what it is or what it does? Thank you!

1 Accepted Solution

Accepted Solutions

M02@rt37
VIP
VIP

Hello @modular182 

The command `ip dhcp-server x.x.x.x` on your catalyst 9500 is used to configure the switch as a DHCP client rather than a relay or server. This command specifies the IP address of a DHCP server that the switch itself should use to obtain an IP address for its interfaces or management purposes. This is not related to the traditional `ip helper-address` command that forwards DHCP requests from clients on the switch to a remote DHCP server; instead, it instructs the switch to query the specified DHCP servers to obtain its own IP configuration.

Given that this switch is likely intended to function as a DHCP relay agent, the absence of `ip helper-address` commands on the relevant interfaces could be the reason why clients connected to the switch are not receiving DHCP leases from the Windows server.

The correct approach would be to remove the `ip dhcp-server` command if it’s not needed and instead configure the appropriate `ip helper-address` under the interfaces where DHCP clients reside. This will forward the DHCP requests from clients to the Windows DHCP servers, allowing them to obtain IP addresses correctly.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

5 Replies 5

M02@rt37
VIP
VIP

Hello @modular182 

The command `ip dhcp-server x.x.x.x` on your catalyst 9500 is used to configure the switch as a DHCP client rather than a relay or server. This command specifies the IP address of a DHCP server that the switch itself should use to obtain an IP address for its interfaces or management purposes. This is not related to the traditional `ip helper-address` command that forwards DHCP requests from clients on the switch to a remote DHCP server; instead, it instructs the switch to query the specified DHCP servers to obtain its own IP configuration.

Given that this switch is likely intended to function as a DHCP relay agent, the absence of `ip helper-address` commands on the relevant interfaces could be the reason why clients connected to the switch are not receiving DHCP leases from the Windows server.

The correct approach would be to remove the `ip dhcp-server` command if it’s not needed and instead configure the appropriate `ip helper-address` under the interfaces where DHCP clients reside. This will forward the DHCP requests from clients to the Windows DHCP servers, allowing them to obtain IP addresses correctly.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Great info. Thank you for the help!

The ip dhcp-server vrf command form can be used only when the device is used as an
Intelligent Services Gateway (ISG) for sending lease queries. For basic DHCP client
configuration (enabled using the command ip address dhcp), the vrf keyword is not needed.

that correct answer, when SW interface need to IP we can config ip add dhcp under interface and hence this interface become SW dhcp client 

ip dhcp-server is used for ISG

Intelligent Services Gateway Configuration Guide, Cisco IOS XE Release 3S - Overview of ISG [Cisco IOS XE 3S] - Cisco

MHM

Friend are you sure this is answer ?
can you share doc about this 
thanks 

MHM

Joseph W. Doherty
Hall of Fame
Hall of Fame

You're right, very little to no information to be found on use of this command.

Is your Windows DHCP server one of the IPs listed?

From a Cisco router"

nserthostname-here(config)#ip dhcp-server ?
  Hostname or A.B.C.D  IP address or Name of DHCP server

Which, with a Name option, would seem to imply an external DHCP server.

Yes, I've found several example of setting up an internal DHCP server with a step like:

 

JosephWDoherty_1-1724188752653.png

In the above, also find:

Verifying Internal DHCP Configuration
To verify client binding, use the following command:

Device# show ip dhcp binding 

Bindings from all pools not associated with VRF:
IP address      Client-ID/              Lease expiration        Type       State      Interface
                Hardware address/
                User name
192.168.32.3    0130.b49e.491a.53       Mar 23 2018 06:42 PM    Automatic  Active     Loopback0

To verify the DHCP relay statistics for a wireless client, use the following command:

Device# show wireless dhcp relay statistics 

DHCP Relay Statistics
---------------------

DHCP Server IP :   10.10.10.1

Message              Count
--------------------------
DHCPDISCOVER      :  1
BOOTP FORWARD     :  137
BOOTP REPLY       :  0
DHCPOFFER         :  0
DHCPREQUEST       :  54
DHCPACK           :  0
DHCPNAK           :  0
DHCPDECLINE       :  0
DHCPRELEASE       :  0
DHCPINFORM        :  82

Tx/Rx Time :
------------
LastTxTime : 18:42:18
LastRxTime : 00:00:00

Drop Counter :
-------------
TxDropCount : 0

Where the IP address does appear to be "external".

So, possibly this command determines what, and/or modified, DHCP packets are allowed to flow between DHCP clients and the external DHCP server.

Possibly somewhat similar to the additional configuration commands, like your global IP dhcp relay information that modify the default actions of the interface IP helper-address command.

Review Cisco Networking for a $25 gift card