Back to Command Reference
Interface ConfigDomain 3.0

ip address [ip] [subnet-mask]

Assigns a logical IPv4 address and subnet mask to a network interface. This defines the interface's local broadcast domain boundaries and populates the device's routing engine with its initial directly connected networks.

Quick Reference

Execution ModeRouter(config-if)#
Mask StructureDotted-Decimal format (e.g., 255.255.255.0)
Max IPs Per Interface1 Primary (plus optional Secondary)
Negation Commandno ip address

Syntax & Parameters

ip address [ip-address] [subnet-mask]
ParameterDescription & Format Guidelines
[ip-address]The host IPv4 address targeted for the node.
  • Must be a valid host address within the calculated block boundaries.
  • Cannot be a network ID or directed broadcast address.
[subnet-mask]The subnet mask designating network vs. host bits.
  • Must be provided in explicit dotted-decimal form.
  • CIDR notation (e.g., /24) is rejected by the Cisco IOS CLI parser.

CLI Deployment Scenarios

Scenario 1: Direct Interface Provisioning

Configuring the local gateway interface on a router for a standard /24 corporate subnet block.

Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 10.20.30.1 255.255.255.0
Router(config-if)# no shutdown

Scenario 2: Overwriting an Address Assignment

You need to change the IP address on an interface from its current configuration to a new topology schema.

Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
! Note: Executing this directly overwrites the old 10.20.30.1 layout without needing to type "no ip address" first.

CCNA Exam Gotchas

[!]

The Switchport L2 vs. L3 Barrier

If you navigate to a standard port on a Layer 3 switch (like a Catalyst 3750) and execute ip address 10.1.1.1 255.255.255.0, the command parser will fail completely with an "Invalid input detected" carrot marker under the word "ip".

The Solution: Switchports are Layer 2 by default. You must strip away their L2 characteristics by executing the no switchport command first, which converts the physical port into a true routable Layer 3 interface.

[!]

Bad Mask / Overlapping Address Space Failures

Cisco IOS checks for database integrity. If you attempt to assign an IP that sits inside a network spectrum already running on an active alternative interface, the engine will block it and spit out a hard % 10.20.30.0 overlaps with GigabitEthernet0/0 log. Pay strict attention to subnet boundaries during multi-interface lab exams!