O'Reilly logo

Cisco IOS in a Nutshell, 2nd Edition by James Boney

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ip address — interface

Synopsis

ip address address subnet-mask [secondary]
no ip address address subnet-mask [secondary]

Configures

The IP address for an interface

Default

No IP address

Description

This command sets the IP address for the interface to address; the network mask used on the network is subnet-mask. The secondary keyword is used to apply a second (or third, or fourth... ) address to an interface. It is allowed only if the interface allows multiple IP addresses.

Example

This command sets the IP address of the ethernet0 interface to 10.10.1.1 and the subnet mask to 255.255.255.0:

interface ethernet0
  ip address 10.10.1.1 255.255.255.0

The following commands use the secondary keyword to add a second IP address to the ethernet0 interface:

interface ethernet0
  ip address 10.10.1.1 255.255.255.0
  ip address 10.10.2.1 255.255.255.0 secondary

This interface will now answer and provide routing for both the 10.10.1.0/24 and 10.10.2.0/24 subnets.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required