The ip address command assigns an IPv4 address and netmask to a Cisco router interface. Infrastructure addresses are usually configured manually, unlike end-host addresses commonly supplied by DHCP. section 7.3.2
Configure an interface address in this sequence:
- Enter privileged EXEC mode, global configuration mode, and then interface configuration mode with interface interface-name. section 7.3.2 section 7.4
- Enter ip address ip-address netmask, such as ip address 192.168.1.1 255.255.255.0, to assign a /24 address. section 7.4
- Enable the interface with no shutdown; router interfaces are disabled by default. section 7.4
- Verify the result with show ip interface brief, which reports the address and whether the interface and protocol are up. section 7.4
Assign addresses to two router interfaces
R1(config)# interface gigabitethernet0/0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface g0/1 R1(config-if)# ip address 192.168.2.1 255.255.255.0 R1(config-if)# no shutdown Afterward, show ip interface brief reports G0/0 as 192.168.1.1 and G0/1 as 192.168.2.1, with both interfaces up/up.
