IOS as DHCP server with ip helper-address

Answered Question
Nov 21st, 2007

A client has a remote office wherein an L3 switch is configured with ip helper-addresses (on multiple vlan interfaces) configured to obtain their IP address from the head office. But due to the often-times unreliable WAN link, end users are sometimes unable to get an IP address.


My solution was to configure the remote L3 switch (3750) as the backup DHCP server and to enable it when the WAN link goes down. I thought that it was a simple transition of by just removing/reinstating the IP helper-address commands, I'll have control on where users can get their IP addresses (local switch or remote DHCP).


However, I was surprised to find out that even with an ip helper-address defined, the users were getting their IP addresses from the switch. I was under the impression that once an ip helper-address is defined, it will take precedence over the built-in IOS DHCP server.


Is this the true behavior of the ip helper-address feature or am I hitting a bug?


Switch IOS version is: 12.2(25r)SEE3


Thanks!

Correct Answer by Richard Burts about 9 years 3 months ago

Orlando


In support of the answer from Glen: yes this is the proper and expected behavior and is NOT a bug. The helper address does not pre-emptivly take over from the locally configured DHCP service. If the local switch has DHCP configured and also has the helper address configured then the switch will forward the DHCP request to the remote DHCP server and will also generate a response to the client to offer its own address pool. You have not correctly understood how it works and Glen has correctly explained it.


HTH


Rick

Correct Answer by glen.grant about 9 years 3 months ago

All the ip helper address does is take a dhcp broadcast request and make it a unicast to the defined address . The clients will usually take the first device which answers first which will be the directly attached switch because it is closer and will respond faster . You would have to turn off the service on the switch first before the primary would take over.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
glen.grant Wed, 11/21/2007 - 19:12

All the ip helper address does is take a dhcp broadcast request and make it a unicast to the defined address . The clients will usually take the first device which answers first which will be the directly attached switch because it is closer and will respond faster . You would have to turn off the service on the switch first before the primary would take over.

Correct Answer
Richard Burts Wed, 11/21/2007 - 19:57

Orlando


In support of the answer from Glen: yes this is the proper and expected behavior and is NOT a bug. The helper address does not pre-emptivly take over from the locally configured DHCP service. If the local switch has DHCP configured and also has the helper address configured then the switch will forward the DHCP request to the remote DHCP server and will also generate a response to the client to offer its own address pool. You have not correctly understood how it works and Glen has correctly explained it.


HTH


Rick

oj88 Wed, 11/21/2007 - 20:47

Glen, Rick... thanks for clearing that up.


Another related question; I wanted to leave the client with the shortest script to enable/disable local switch DHCP. I know that the "no service dhcp" command would effectively disable the switch DHCP in a single command. But, will it affect the function of ip helper-address? I know I read that dhcp relay is also turned off with "no service dhcp", but I just need confirmation.

Duong Nguyen Wed, 05/09/2012 - 14:29

Bumping


But, will it affect the function of ip helper-address? I know I read  that dhcp relay is also turned off with "no service dhcp", but I just  need confirmation.



I too would like to if this is true or not.

Richard Burts Wed, 05/09/2012 - 15:54

I have not tested this recently and so am not authoritative. But I am pretty sure that no service dhcp does not have any impact on the behavior of ip helper-address.


HTH


Rick

Duong Nguyen Thu, 05/10/2012 - 15:30

Correct me if I am wrong,


disabling the dhcp service will also disable the relay agent (ip helper). Because of this the dhcp service needs to be enabled (which is default), but it does not need to be running for ip helper to work.


By “running” I mean that a dhcp pool does not need to be configured. In the enabled but ‘not running’ mode the dhcp service will relay DHCP requests when the ip helper command is used, but it does not respond to DHCP requests on UDP port 67 or 68 itself. So in enabled/not-running mode the relay agent works, but the DHCP server service is not active. With disabled (no service dhcp) mode both the DHCP relay agent and built-in DHCP server are disabled.

Actions

This Discussion