Configuring IP Addresses

How to Configure IP Addresses

The following topics provide information about the procedures that you can perform to configure IP addresses.

Configuring an Interface IP Address and an IP Access Range

To configure an interface IP address and an IP access range, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

vlan vlan-list

Example:

Device(config)# vlan 1-50

Creates a VLAN or a list of VLANs. Enters VLAN configuration mode.

Step 4

switchport ethernet port

Example:

Device(config-if-vlan)# switchport ethernet 1/1

Adds a port to the VLAN.

Step 5

interface vlan-interface vlan-id

Example:

Device(config-if-vlan)# interface vlan-interface 1

Creates the VLAN interface.

Step 6

ip address { ip-address mask-ip-address override | primary ip-address}

Example:

Device(config-if-vlan)# ip address primary 192.0.2.1

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:

Device(config-if-vlan)# ip address range 192.0.2.254 192.0.2.255

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.

Configuring a Loopback Interface

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.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

interface loopback-interface interface-number

Example:

Device(config)# interface loopback-interface 1

Creates a loopback interface. Enters loopback interface configuration mode.

Step 4

ip address ip-address mask-ip-address

Example:

Device(config-if-loopbackinterface)# ip address 192.0.2.1 192.0.2.254

Configures a loopback interface for the IP address.

Configuring IP Parameters on an Interface VLAN

To configure the system IP parameters under an interface VLAN for Layer 3 devices, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ip icmp mask-reply

Example:

Device(config)# ip icmp mask-reply

Enables the Internet Control Message Protocol (ICMP) address mask reply packet.

Step 4

interface vlan-interface vlan-id

Example:

Device(config)# interface vlan-interface 1

Enters interface VLAN mode.

Step 5

ip icmp unreachable

Example:

Device(conifg-if-vlanif)# ip icmp unreacheable

Enables the task of sending ICMP destination unreachable packets.

Step 6

description interface-name

Example:

Device(config-if-vlanif)# description interface1

Configures the IP interface description.

You can delete the description of the IP interface by using the no description command.

Configuring Interface Shutdown

To shut down an interface, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

interface vlan-interface vlan-id

Example:

Device(config)# interface vlan-interface 1

Enters interface VLAN mode.

Step 4

shutdown

Example:

Device(config-if-vlanif)# shutdown

Shuts down the VLAN interface.

You can cancel the shut down of the interface by using the no shutdown command.

Verifying the Interface IP Address Configuration

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.