cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
48284
Views
40
Helpful
10
Replies

Auto clear ip dhcp conflict *?

jasonww04
Level 1
Level 1

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.

2 Accepted Solutions

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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).

View solution in original post

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 .

View solution in original post

10 Replies 10

Jon Marshall
Hall of Fame
Hall of Fame

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

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

Joe Clarke
Cisco Employee
Cisco Employee

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).

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.

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 .

It works perfectly. Thanks for the help.

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 *"

Hi, what is the meaning of this below line

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

 

can u plz give some example of "time" instead of zero 0 0  and * * starts.

this can help me to understand what actually this command do.

 

I have tried these commands in our router, but it didn't clear the dhcp conflict. Does this required enable password in action 2.0 after "enable" command.

Hello

You can use  ip dhcp conflict resolution

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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco