routing commands
Here is a comprehensive routing command cheat sheet specifically tailored to the IP Connectivity objectives (Section 3.0) of the CCNA 200-301
### 1. General Routing & Verification
Before configuring routes, you must know how to read the router's current state and routing table.
| Command | Description |
|---|---|
| show ip route | Displays the entire IPv4 routing table. Look for C (Connected), L (Local), S (Static), and O (OSPF). |
| show ipv6 route | Displays the IPv6 routing table. |
| show ip route [ip_address] | Shows the specific path the router will use to reach a given destination IP. |
| show ip protocols | Displays parameters, timers, and states of any active IPv4 routing protocols (like OSPF). |
### 2. IPv4 Static Routing
Static routes are manually entered. The CCNA tests your ability to configure network, host, default, and floating static routes.
| Route Type | Command Syntax / Example |
|---|---|
| Standard Network Route | ip route [destination_network] [subnet_mask] [next_hop_ip OR exit_interface]
Example: ip route 10.1.2.0 255.255.255.0 192.168.1.2 |
| Host Route
(Targets a single specific IP) | ip route [destination_host_ip] 255.255.255.255 [next_hop_ip]
Example: ip route 10.1.2.50 255.255.255.255 192.168.1.2 |
| Default Route
(Gateway of last resort) | ip route 0.0.0.0 0.0.0.0 [next_hop_ip OR exit_interface]
Example: ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0 |
| Floating Static Route
(Backup route using AD) | Add the Administrative Distance at the end of the standard command. (Default static AD is 1).
Example: ip route 10.1.2.0 255.255.255.0 192.168.1.3 5 |
### 3. IPv6 Static Routing
IPv6 routing works identically to IPv4, but you must explicitly turn on IPv6 routing capabilities first.
| Action | Command Syntax / Example |
|---|---|
| Enable IPv6 Routing | ipv6 unicast-routing (Must be run in global config mode before any IPv6 routing works) |
| Standard IPv6 Route | ipv6 route [ipv6_network/prefix_length] [next_hop_ipv6]
Example: ipv6 route 2001:db8:acad:2::/64 2001:db8:acad:1::2 |
| IPv6 Default Route | ipv6 route ::/0 [next_hop_ipv6 OR exit_interface]
Example: ipv6 route ::/0 2001:db8:acad:1::2 |
### 4. Single-Area OSPFv2 Configuration
The CCNA requires you to configure single-area OSPF (usually Area 0) for IPv4. There are two ways to enable OSPF on an interface: using the global network command or configuring it directly under the interface.
| Action | Command Syntax |
|---|---|
| Start OSPF Process | router ospf [process_id] (Process ID is locally significant, e.g., 10) |
| Set Router ID | router-id [ipv4_address] (Hardcodes the OSPF name for the router, e.g., 1.1.1.1) |
| Enable OSPF (Method 1)
Global Config | network [network_address] [wildcard_mask] area 0
Example: network 192.168.1.0 0.0.0.255 area 0 |
| Enable OSPF (Method 2)
Interface Config | ip ospf [process_id] area 0
(Run directly inside the interface configuration mode) |
| Set Passive Interface | passive-interface [interface_id]
(Stops OSPF hellos from sending out end-user ports) |
| Inject Default Route | default-information originate
(Tells OSPF to advertise the router's static default route to other OSPF routers) |
| Adjust Reference Bandwidth | auto-cost reference-bandwidth [megabits_per_second]
(Run on all routers to ensure interfaces faster than 100Mbps are calculated correctly) |
### 5. OSPFv2 Verification
Troubleshooting OSPF neighbor relationships is a common exam topic.
| Command | Description |
|---|---|
| show ip ospf neighbor | Crucial command. Verifies if the router has successfully formed an adjacency with other OSPF routers (look for the "FULL" state). |
| show ip ospf interface brief | Shows a quick summary of all interfaces running OSPF, the process ID, the area, and the cost of the link. |
| show ip protocols | Verifies the OSPF process ID, the configured Router ID, and which networks are currently being advertised. |