You must remove all secondary IP addresses, if they exist, before replacing the existing primary IP address with a new IP address.
-
NOTE
The device does not prompt, if no primary IP address matching subnet of the new IP address is already configured on interface and the user use the
replace option. When the
ip address command is used with the
replace option, the new IP address is configured.
Enter global configuration mode.
device# configure termainal
-
Use the
interface
command to enter interface configuration mode.
device (config)# interface ethernet 1/1/21
-
Use the ip address command to replace an existing primary IP address with a new IP address. Note that when you choose the replace option to remove the existing IP address on an interface, the action cannot be undone.
device(config-if-e1000-1/1/21)# ip address 10.1.1.1/24 replace
-
Use the
show running interface command to display the newly configured IP address on the interface.
device(config-if-e1000-1/1/21)# show running interface ethernet 1/1/21
The
replace option is not displayed in running or startup configurations.
The following example shows how to replace the primary IP address of an interface.
device# configure terminal
device(config)# interface ethernet 1/1/21
device(config-if-e1000-1/1/21)# ip address 10.1.1.1/24 replace
The following example shows how to display the primary IP address of an interface.
device(config-if-e1000-1/1/21)# show running interface ethernet 1/1/21
interface ethernet 1/1/21
ip address 11.1.1.2 255.255.255.0!