I have a switch running classic IOS 15.7. One function that I am trying depends on knowing if it is disconnected from DHCP server. The switch port is connected to another switch and it gets its IP using DHCP. e.g.
int Vlan 1
ip dhcp client lease 0 0 1
ip address dhcp
I found that "ip dhcp client lease" will sometime be overrode by the server's lease duration. If the server specified a longer duration, the client will obey.
I know about "release dhcp" and "renew dhcp" commands. However, I found that "renew dhcp" only renews but does not release and it also cannot renew while the release is in progress.
The only workaround I found is shut and no shut the vlan interface. I am trying to avoid any config change. Any other ideas?