RoutingPrivileged EXEC

clear ip route *

Clears all entries from the IP routing table, forcing the router to rebuild the routing table from active routing protocols and directly connected networks.

Syntax·Privileged EXEC
clear ip route *

When to Use This Command

  • After making major routing protocol configuration changes to force immediate route recalculation
  • When troubleshooting routing loops or stale routes that are not being updated automatically
  • Before performing a routing protocol convergence test in a lab environment
  • When a router has incorrect routes due to a routing protocol malfunction

Command Examples

Clear entire IP routing table

clear ip route *
Router# clear ip route *
Router#

No output is displayed after the command. The prompt returns immediately, indicating the routing table has been cleared. Use 'show ip route' to verify the table is empty and being repopulated.

Verify routing table after clearing

show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, GigabitEthernet0/0
L    192.168.1.1/32 is directly connected, GigabitEthernet0/0
C    10.0.0.0/24 is directly connected, Serial0/0/0
L    10.0.0.1/32 is directly connected, Serial0/0/0
O    172.16.0.0/16 [110/2] via 10.0.0.2, 00:00:05, Serial0/0/0

After clearing, only directly connected and local routes appear immediately. OSPF routes (O) are repopulated after neighbor adjacency re-establishment. The '[110/2]' shows administrative distance (110 for OSPF) and metric (2). '00:00:05' indicates the route age in hours:minutes:seconds since learned.

Understanding the Output

The 'clear ip route *' command itself produces no output. To verify the effect, use 'show ip route'. Initially, only directly connected (C) and local (L) routes appear. Over time, routes from dynamic routing protocols (e.g., O, D, R) reappear as the router re-establishes neighbor relationships and exchanges routing information. Key fields in 'show ip route' output: the code (C, O, D, etc.) indicates the route source; the network address and prefix length (e.g., 192.168.1.0/24); for non-connected routes, the administrative distance and metric in brackets (e.g., [110/2]); the next-hop IP address (via); the route age; and the outgoing interface. A missing route that was previously present indicates a problem with the routing protocol or connectivity. Watch for incomplete routing tables or missing routes after clearing, which may indicate configuration errors or network issues.

CCNA Exam Tips

1.

CCNA exam tip: 'clear ip route *' is a privileged EXEC command; you cannot use it in user EXEC mode.

2.

CCNA exam tip: This command temporarily disrupts traffic because routes are removed; use with caution in production.

3.

CCNA exam tip: The asterisk (*) is a wildcard; you can also clear specific routes (e.g., 'clear ip route 192.168.1.0') or routes from a specific protocol (e.g., 'clear ip route ospf *').

4.

CCNA exam tip: After clearing, the router will not have a default route until it is learned or reconfigured; verify with 'show ip route'.

Common Mistakes

Mistake 1: Using 'clear ip route *' in user EXEC mode instead of privileged EXEC mode, resulting in '% Invalid input detected' error.

Mistake 2: Forgetting that clearing the routing table will drop all active traffic that relies on those routes until they are relearned.

Mistake 3: Assuming the command will fix routing issues without verifying that routing protocols are properly configured and neighbors are reachable.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions