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
Router(config-if)#(e.g., 255.255.255.0)(plus optional Secondary)no ip addressSyntax & Parameters
| Parameter | Description & Format Guidelines |
|---|---|
| [ip-address] | The host IPv4 address targeted for the node.
|
| [subnet-mask] | The subnet mask designating network vs. host bits.
|
CLI Deployment Scenarios
Scenario 1: Direct Interface Provisioning
Configuring the local gateway interface on a router for a standard /24 corporate subnet block.
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.
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!