A single primary network IPv4 address is configurable on an interface. Up to 100 secondary network IPv4 addresses are configurable. The first network IP address assigned to an interface is the primary whether explicitly configured as primary or not. To configure a secondary network IP address on an interface, the address must be explicitly configured as secondary, otherwise you will be queried as to whether you want to overwrite the current primary.
In the following example the IP address is set to 99.0.0.1/24. This setting is followed by an attempt to configure 99.0.0.2/16 as a secondary address, while failing to specify the secondary keyword. When queried as to whether the primary IP address should be changed, n is entered. The secondary keyword is added on the next line. The show running-config command output confirms the configuration:
System(rw-config-intf-vlan.0.99)->ip address 99.0.0.1/24 System(rw-config-intf-vlan.0.99)->ip address 99.0.0.2/16 Do you want to replace primary IP address (y/n) [n]?n System(rw-config-intf-vlan.0.99)->ip address 99.0.0.2/16 secondary System(rw-config-intf-vlan.0.99)->show running-config interface vlan.0.99 # **** VRF default (default) **** configure terminal ! interface vlan.0.99 ip address 99.0.0.1 255.255.255.0 primary ip address 99.0.0.2 255.255.0.0 secondary exit ! exit System(rw-config-intf-vlan.0.99)->
The ip address command in interface configuration command mode is used to assign IP networks as primary or secondary to a routing interface.
See IPv6 Interface Address for IPv6 address configuration information.
The no ip address command removes the specified IPv4 address configuration for this interface.