ip address — interface
address subnet-mask[secondary] no ip address
The IP address for an interface
No IP address
This command sets the IP address for the interface to
address; the network mask used on the network is
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.
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
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.