Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Adding and Deleting IP Addresses

    This topic provides information about adding or deleting IP addresses.

    Multinetting is adding more than one IP address to an IP interface—that is, a primary address and one or more secondary addresses.

    Note:

    • Before you configure IP, you must create the lower-layer interfaces over which IP traffic flows.
    • All IP configurations will be removed from the interface when you issue the no ip interface command in Interface Configuration mode.

    You can add or delete IP primary and secondary addresses for an interface with the following tasks:

    Adding and Deleting a Primary Address

    You can add IP primary address to an interface or delete the existing primary address using the ip address command.

    Note:

    • The primary address must be the first address added to the interface.
    • Adding a new primary address overwrites the existing primary address.
    • You can change a secondary address to be the primary address on an interface only via SNMP.
    • An unnumbered address is always the primary address; adding an unnumbered address, therefore, overwrites any other numbered address.
    • You must always remove the primary address from an interface last.
    • You cannot delete the primary address if the interface still has assigned secondary addresses.

    To add a primary address:

    • Issue the ip address command in Interface Configuration mode.
      host1(config-if)#ip address 192.168.2.77 255.255.255.0

      You can specify the subnetwork mask value in either dotted decimal or prefix length notation.

      Note: You can use this command in Subinterface Configuration mode or Profile Configuration mode.

      Use the no version to remove an IP address. If you remove a primary IP address, IP processing is disabled on the interface.

    Adding and Deleting a Secondary (Multinet) Address

    You can add a secondary IP address to an interface or delete the assigned secondary address using the ip address command with the secondary keyword.

    Note:

    • You cannot add a secondary address until you add the primary address.
    • You cannot add a secondary address to bridged Ethernet interfaces.
    • You cannot change a primary address to a secondary address.
    • An interface can have multiple secondary addresses.
    • You must delete secondary addresses before deleting the primary address.
    • If you add an address using the ip address command and do not include the secondary keyword, the new address becomes the primary address.

    To add a secondary address:

    • Issue the ip address command with the secondary keyword.
      host1(config-if)#ip address 172.31.7.22 255.255.255.0 secondary

      You can specify the subnetwork mask value in either dotted decimal or prefix length notation.

      Note: You can use this command in Subinterface Configuration mode or Profile Configuration mode.

      Use the no version to remove an IP address.

    Published: 2014-08-13