Static entry in use, cannot remove

Have you ever tried to remove a NAT entry on a Cisco router only to get the error message Static entry in use, cannot remove?

Here is a way to get the job done

Error message

gw01#conf t
Enter configuration commands, one per line. End with CNTL/Z.
gw01(config)#no ip nat inside source static udp 192.168.41.10 5060 interface Dialer0 5060
%Static entry in use, cannot remove
gw01(config)#exit

Incase you mess it up schedule the reload command in ten minutes and the router will boot up from the startup-config

gw01#conf t
Enter configuration commands, one per line. End with CNTL/Z.
gw01#reload in 10
Reload scheduled for 07:06:18 UTC Fri Jan 4 2013 (in 10 minutes) by admin on vty0 (192.168.5.69)
Reload reason: Reload Command
Proceed with reload? [confirm]

Change the command to suite your interfaces I am using BVI1 and dialer0

gw01#conf t
Enter configuration commands, one per line. End with CNTL/Z.
gw01(config)#interface BVI1
gw01(config-if)#no ip nat inside
gw01(config-if)#exit
gw01(config)#interface Dialer0
gw01(config-if)# no ip nat outside
gw01(config-if)# exit
gw01(config)#do clear ip nat translation forced
gw01(config)#no ip nat inside source static udp 192.168.41.10 5060 interface Dialer0 5060
gw01(config)#interface BVI1
gw01(config-if)# ip nat inside
gw01(config-if)# exit
gw01(config)#interface Dialer0
gw01(config-if)# ip nat outside
gw01(config-if)# exit
gw01(config)#exit

Save the running-config to the startup-config

gw01#wr
Building configuration…
[OK]
gw01#

That’s it.