Auto clear ip dhcp conflict *?

Answered Question
Oct 27th, 2010
User Badges:

Is there a command or config that will make a router automatically clear ip dhcp conflict * on a regular basis? I have a site that constantly has a problem with DHCP due to conflicts which is fixed simply by clearing the conflict table. If we could automate this, it would be great.

Correct Answer by Joe Clarke about 6 years 6 months ago

No, it won't write a log message, but you could add one:


action 3.0 syslog msg "Cleared IP DHCP conflict records"


You can read more about EEM from http://www.cisco.com/go/eem .

Correct Answer by Joe Clarke about 6 years 6 months ago

You can use EEM for this.  This EEM applet will run the "clear ip dhcp conflict *" command every night at midnight.


event manager applet clear-dhcp-conflict

event timer cron cron-entry "0 0 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "clear ip dhcp conflict *"


This assumes you have a release of IOS that supports EEM 2.1 or higher (which covers the majority of recent IOS releases).

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (4 ratings)
Loading.
Jon Marshall Wed, 10/27/2010 - 09:35
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

jasonww04 wrote:


Is there a command or config that will make a router automatically clear ip dhcp conflict * on a regular basis? I have a site that constantly has a problem with DHCP due to conflicts which is fixed simply by clearing the conflict table. If we could automate this, it would be great.


Jason


I suspect this could be done with EEM. The expert for this sort of thing usually answers questions in the Network Mangement forum so you should move this post there.


Jon

jasonww04 Wed, 10/27/2010 - 13:49
User Badges:

Thank you. I moved it to Network Management, per your suggestion.

Correct Answer
Joe Clarke Wed, 10/27/2010 - 21:48
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You can use EEM for this.  This EEM applet will run the "clear ip dhcp conflict *" command every night at midnight.


event manager applet clear-dhcp-conflict

event timer cron cron-entry "0 0 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "clear ip dhcp conflict *"


This assumes you have a release of IOS that supports EEM 2.1 or higher (which covers the majority of recent IOS releases).

jasonww04 Thu, 10/28/2010 - 07:30
User Badges:

I put the command in exactly as you wrote it. When it runs, will it leave an entry in the log?


Also, can you point me to beginner documentation on the event manager? It seems like it could be really useful.

Correct Answer
Joe Clarke Thu, 10/28/2010 - 07:34
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

No, it won't write a log message, but you could add one:


action 3.0 syslog msg "Cleared IP DHCP conflict records"


You can read more about EEM from http://www.cisco.com/go/eem .

fearless.rabbit Wed, 07/17/2013 - 01:57
User Badges:

I modified your example to solve similar issue. I wanted it run every hour though. Here's how to modify Cron format:


https://en.wikipedia.org/wiki/Cron#Predefined_scheduling_definitions


My EEM simple script:


DV-CORE(config)#event manager applet ClearDHCP

DV-CORE(config-applet)#event timer cron cron-entry "0 * * * *"

DV-CORE(config-applet)#action 1.0 cli command "enable"

DV-CORE(config-applet)#action 2.0 cli command "clear ip dhcp conflict *"

DV-CORE(config-applet)#action 3.0 cli command "clear ip dhcp binding *"

Valery Kuznetsov Wed, 11/21/2012 - 03:25
User Badges:
  • Silver, 250 points or more
  • Почетные Знаки Сообщества,

    Выбор участников, Июль 2015

Hello

You can use  ip dhcp conflict resolution

Actions

This Discussion