Assigning an IPv4 address to a Cisco router interface is straightforward when the addressing plan is correct, but the command alone does not guarantee connectivity. A working configuration depends on the interface’s operational state, subnet boundaries, routes, neighboring devices and any security policy on the traffic path. The example below uses the Cisco IOS/IOS XE command style for a simple routed-interface lab; actual names and commands vary by platform and software version.
Prepare the address plan before changing the router
Identify each routed interface, its connected network and the expected next-hop relationship. In this lab, the router connects two distinct IPv4 networks using GigabitEthernet0/0 and GigabitEthernet0/1. The addresses are from the documentation-only TEST-NET ranges, so substitute addresses from your own authorized plan in a real environment.
| Lab interface | IPv4 address | Subnet mask | Connected network |
|---|---|---|---|
| GigabitEthernet0/0 | 192.0.2.1 | 255.255.255.0 | 192.0.2.0/24 |
| GigabitEthernet0/1 | 198.51.100.1 | 255.255.255.0 | 198.51.100.0/24 |
The two networks do not overlap in the same routing table. Each attached host must have a suitable address and mask, with the corresponding router interface set as its gateway when routing is needed. For a deeper explanation of network-prefix selection, see the site’s CIDR notation guide.
Configure IPv4 on the routed interfaces
From an authorized console or secure management session, enter privileged EXEC and global configuration modes. On many IOS/IOS XE routers, the following sequence is a typical lab example:
enable
configure terminal
interface GigabitEthernet0/0
description LAB-NET-A
ip address 192.0.2.1 255.255.255.0
no shutdown
exit
interface GigabitEthernet0/1
description LAB-NET-B
ip address 198.51.100.1 255.255.255.0
no shutdown
end
interface selects the specific Layer 3 interface. The ip address command assigns the address and mask; no shutdown removes an administrative shutdown state. It does not fix a disconnected cable, disabled switch port or mismatched transceiver. The interface may remain down until the physical and data-link conditions are satisfied.
Do not paste this example into a production device without confirming its interface naming, current configuration, maintenance window and rollback procedure. A switchport operating only at Layer 2 may need an appropriate routed-interface or SVI configuration instead. Cisco IOS XR uses a different configuration/commit workflow from the IOS/IOS XE example shown here.
Verify the result before saving
Verification should test both the configured value and the actual operating state:
show ip interface brief
show running-config interface GigabitEthernet0/0
show running-config interface GigabitEthernet0/1
show ip route connected
show ip interface brief displays interface addresses and the Status/Protocol fields. Look for the expected IP addresses and operationally up links. The running-config checks confirm the entered values, while show ip route connected checks whether connected routes have been installed for usable interfaces.
If the interfaces are operational and hosts are attached to both networks, test reachability with an authorized ping from a host or router. A failed ping does not by itself prove the address is wrong; ICMP could be filtered, a host gateway may be incorrect, or an intermediate link may be down.
When does inter-network communication work?
The router can forward traffic between directly connected networks when interfaces and routes are active and policy allows it. For a host in 192.0.2.0/24 to communicate with one in 198.51.100.0/24, each needs a valid address, mask and appropriate return path. If either host points to a different gateway, return traffic may take a wrong route or be dropped.
Traffic to a network beyond the two directly attached segments requires another route, such as a valid static default route or an appropriate dynamic routing protocol. Do not add a default route merely to make a lab command appear to work; choose the next hop only after verifying the upstream routing design.
Common causes of failure
| Observed symptom | Likely check |
|---|---|
| Interface shows administratively down | Review the configuration and whether no shutdown is authorized |
| Interface configured but line protocol down | Check physical link, switch port, cabling, encapsulation and peer state |
| Router reaches one subnet but not the other | Check the correct interface, masks, routes, ACLs and return path |
| Hosts on the same VLAN cannot reach their gateway | Check VLAN membership, ARP, addressing and relevant Layer 2 controls |
| Ping fails but an application works | Determine whether ICMP is filtered before changing routing |
| Unexpected duplicate IP warning | Confirm address allocation and competing endpoints before reconnecting devices |
Keep IPv4 configuration maintainable
Document the purpose of each interface, its subnet, the associated switch/VLAN, the routing table or VRF in use and the intended change owner. Verify access-control rules separately: a properly addressed interface does not enforce authorization on its own. Prefer an approved configuration-management process and avoid exposing passwords, management credentials or production addressing details in study notes.
After validation, and only if the change should persist across reloads, save the intended configuration according to the platform’s process. On many IOS/IOS XE systems, an operator can use copy running-config startup-config. Verify what that command will preserve before issuing it on a live device.
Use the correct Cisco documentation for the platform
Cisco’s IOS XE IPv4 addressing guide documents the core interface, ip address and no shutdown workflow. The syntax above is for a representative IOS/IOS XE router, not a guarantee that the same command sequence applies to every Catalyst switch, virtual router or IOS XR device.
Takeaway: choose the correct subnet and interface first, configure the address, confirm operational and connected-route state, then verify the actual traffic path. Treat the IP command as the start of the troubleshooting process, not proof that networking is working.
