The Clear Ip Route Cisco command

Command: clear ip route

Function: Removes all entries from the IP routing table.

Syntax:

clear ip route [<address> | <network> | <wildcard> | <all>]

Parameters:

  • <address>: Specifies the IP address of the route that you want to remove.
  • <network>: Specifies the network address of the route that you want to remove.
  • <wildcard>: Specifies the wildcard mask of the route that you want to remove.
  • <all>: Removes all routes from the IP routing table.

Use:

Theclear ip routecommand is used to remove routes from the IP routing table. This can be useful if you are troubleshooting a routing problem or reconfiguring your network.

Equipment:

Theclear ip routecommand can be used on all Cisco routers.

Output:

Theclear ip routecommand does not generate any output.

Additional Information:

  • Theclear ip routecommand only removes routes from the IP routing table. It does not affect the configuration of the router’s interfaces.
  • You can use theshow ip routecommand to verify that the routes have been removed from the routing table.
  • Theclear ip routecommand is equivalent to thedelete ip routecommand.

clear ip route Usage Examples

The Cisco commandclear ip routeis used to clear the routing table. Here are some examples of how to use this command:

  1. Clear the entire routing table:
clear ip route *

This command will clear all the entries from the routing table.

  1. Clear a specific route:
clear ip route <destination-prefix>

This command will clear the route to the specified destination prefix. For example, to clear the route to the 10.0.0.0/24 network, you would use the following command:

clear ip route 10.0.0.0/24
  1. Clear a route based on the administrative distance:
clear ip route <administrative-distance>

This command will clear all the routes with the specified administrative distance. For example, to clear all the routes with an administrative distance of 120, you would use the following command:

clear ip route 120
  1. Clear a route based on the protocol:
clear ip route <protocol>

This command will clear all the routes that were learned through the specified protocol. For example, to clear all the routes that were learned through OSPF, you would use the following command:

clear ip route ospf
  1. Clear a route based on the source interface:
clear ip route source <interface>

This command will clear all the routes that were learned through the specified interface. For example, to clear all the routes that were learned through the GigabitEthernet0/1 interface, you would use the following command:

clear ip route source GigabitEthernet0/1

Leave a Reply

Your email address will not be published. Required fields are marked *