How to Configure IP Addresses
The following topics provide information about the procedures that you can perform to configure IP addresses.
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
The following topics provide information about the procedures that you can perform to configure IP addresses.
The following topics provide information about the procedures that you can perform to configure IP addresses.
To configure an interface IP address and an IP access range, perform this procedure:
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password, if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
vlan vlan-list Example:
|
Creates a VLAN or a list of VLANs. Enters VLAN configuration mode. |
Step 4 |
switchport ethernet port Example:
|
Adds a port to the VLAN. |
Step 5 |
interface vlan-interface vlan-id Example:
|
Creates the VLAN interface. |
Step 6 |
ip address { ip-address mask-ip-address override | primary ip-address} Example:
|
Configures the IP address for the VLAN interface. The primary keyword configures the IP address for the VLAN interface, and the override keyword overrides the IP address of the VLAN interface. You can delete the interface IP address using the no ip address ipaddress command. |
Step 7 |
ip address range{ start-ip-address end-ip-address} Example:
|
Configures a range of IP addresses for the VLAN interface. You can delete the range of IP addresses for the VLAN interface using the no ip address range command. An interface VLAN can be configured only on Layer 3 devices. One interface can be configured with 32 different network segments. Every VLAN interface can be configured with up to eight IP address access ranges. |
A VLAN interface connects to the port directly, while a loopback interface connects to the port through another VLAN interface. A loopback interface isn't influenced by port status, and is always in the linkup state. It is an advantage if the source IP address for sending packets is a loopback interface.
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password, if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
interface loopback-interface interface-number Example:
|
Creates a loopback interface. Enters loopback interface configuration mode. |
Step 4 |
ip address ip-address mask-ip-address Example:
|
Configures a loopback interface for the IP address. |
To configure the system IP parameters under an interface VLAN for Layer 3 devices, perform this procedure:
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password, if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
ip icmp mask-reply Example:
|
Enables the Internet Control Message Protocol (ICMP) address mask reply packet. |
Step 4 |
interface vlan-interface vlan-id Example:
|
Enters interface VLAN mode. |
Step 5 |
ip icmp unreachable Example:
|
Enables the task of sending ICMP destination unreachable packets. |
Step 6 |
description interface-name Example:
|
Configures the IP interface description. You can delete the description of the IP interface by using the no description command. |
To shut down an interface, perform this procedure:
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password, if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
interface vlan-interface vlan-id Example:
|
Enters interface VLAN mode. |
Step 4 |
shutdown Example:
|
Shuts down the VLAN interface. You can cancel the shut down of the interface by using the no shutdown command. |
To verify the interface IP address configuration, run the following command:
Command |
Description |
---|---|
show ip interface{ loopback-interface loopback-interface-number| vlan-interface vlan-interface-number| meth-interface meth-interface-number} |
Shows IP interface configuration for a Layer 3 device. |