C Commands


This chapter describes the Cisco NX-OS Open Shortest Path First (OSPF) commands that begin with C.

clear ip ospf neighbor

To clear neighbor statistics and reset adjacencies for Open Shortest Path First (OSPF), use the clear ip ospf neighbor command.

clear ip ospf [instance-tag] neighbor {* | neighbor-id | interface-type number | loopback number | port-channel number} [vrf vrf-name]

Syntax Description

instance-tag

(Optional) Instance tag. Specify as an alphanumeric string of up to 20 characters.

*

Clears all neighbors.

neighbor-id

Neighbor ID (as an IP address) of the neighbor to clear.

interface-type number

Interface from which to clear all neighbors.

loopback number

Clears all neighbors on a loopback interface.

port-channel number

Clears all neighbors on a port-channel interface.

vrf vrf-name

(Optional) Specifies the name of the OSPF virtual routing and forwarding (VRF) instance. The vrf-name argument can be any alphanumeric string of up to 32 characters, except "default" and "all".


Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

Use the clear ip ospf neighbor command to clear neighbor information from the show ip ospf neighbor command. Use the instance-tag argument to clear the neighbor details from one OSPF instance. If you do not use the instance-tag argument, Cisco NX-OS clears the neighbor details from all OSPF instances. Use the show ip ospf neighbor command to find the neighbor ID.

This command requires the LAN Base Services license.

Examples

This example shows how to clear all OSPF neighbor details for neighbor 192.0.2.1 for instance tag 201:

switch# clear ip ospf 201 neighbor 192.0.2.1
 
   

This example shows how to clear all OSPF neighbor details for all OSPF instances:

switch# clear ip ospf neighbor *
 
   

This example shows how to clear all OSPF neighbor details for all neighbors on Ethernet interface 1/2 for OSPF instance 202:

switch# clear ip ospf 202 neighbor ethernet 1/2
 
   

Related Commands

Command
Description

show ip ospf neighbor

Displays details for OSPF neighbors including the neighbor ID.


clear ip ospf policy statistics

To clear policy statistics for Open Shortest Path First (OSPF), use the clear ip ospf policy statistics command.

clear ip ospf [instance-tag] policy statistics {area area-id filter-list {in | out} | redistribute {bgp autonomous-system | direct | eigrp id | ospf id | rip id | static}} [vrf vrf-name]

Syntax Description

instance-tag

(Optional) Instance tag. Specify as an alphanumeric string of up to 20 characters.

area

Clears policy statistics for an area.

area-id

Area ID as an integer or IP address.

filter-list

Specifies the policy statistics for filtered prefixes between OSPF areas.

in

Filters prefixes sent into this OSPF area.

out

Filters prefixes sent from this OSPF area.

redistribution

Clears OSPF route redistribution statistics.

bgp autonomous-system

Specifies the autonomous system number for the Border Gateway Protocol. Specify the autonomous system number as x.y, where the range is from 1 to 65535 for both x and y, or as a single integer, where the range is from 1 to 65535.

direct

Specifies directly connected routes.

eigrp id

Specifies the autonomous system number for the Enhanced Interior Gateway Protocol. Specify the id argument as any case-sensitive, alphanumeric string.

ospf id

Specifies the Open Shortest Path First version 2 instance. Specify the id argument as any case-sensitive, alphanumeric string.

rip id

Specifies the Routing Information Protocol instance. Specify the id argument as any case-sensitive, alphanumeric string.

static

Specifies static routes.

vrf vrf-name

(Optional) Specifies the name of the OSPF virtual routing and forwarding (VRF) instance. The vrf-name argument can be any alphanumeric string of up to 32 characters, except "default" and "all".


Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

Use the clear ip ospf statistics command to learn the policy statistics shown in the show ip ospf policy statistics command. Use the instance-tag argument to clear the policy statistics from one OSPF instance. If you do not specify the instance tag, Cisco NX-OS clears the policy statistics from all OSPF instances. Use the show ip ospf policy statistics command to to view the statistics that you are clearing.

This command requires the LAN Base Services license.

Examples

This example shows how to clear all OSPF policy statistics for area 99 inbound filtered routes for OSPF 201:

switch# clear ip ospf 201 policy statistics area 99 filter-list in
 
   

This example shows how to clear all OSPF policy statistics for all BGP redistributed routes for OSPF 202:

switch# clear ip ospf 202 policy statistics redistribute bgp
 
   

Related Commands

Command
Description

show ip ospf policy statistics

Displays details for OSPF policies.


clear ip ospf redistribution

To clear redistribution information for Open Shortest Path First (OSPF) , use the clear ip ospf redistribution command.

clear ip ospf redistribution [vrf {vrf-name | all | default | management}]

Syntax Description

vrf vrf-name

(Optional) Specifies a particular virtual routing and forwarding (VRF) instance. The VRF name is a case-sensitive, alphanumeric string of up to 32 characters.

all

(Optional) Specifies the "all" VRF instance.

default

(Optional) Specifies the default VRF.

management

(Optional) Specifies the management VRF.


Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

This command requires the LAN Base Services license.

Examples

This example shows how to clear redistribution information:

switch# clear ip ospf redistribution
 
   

Related Commands

Command
Description

feature ospf

Enables the OSPF feature.


clear ip ospf statistics

To clear Open Shortest Path First (OSPF) event statistics, use the clear ip ospf statistics command.

clear ip ospf [instance-tag] statistics [vrf vrf-name]

Syntax Description

instance-tag

(Optional) Instance tag. Specify as an alphanumeric string of up to 20 characters.

vrf vrf-name

(Optional) Specifies the name of the OSPF virtual routing and forwarding (VRF) instance. The vrf-name argument can be any alphanumeric string of up to 32 characters, except "default" and "all".


Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

Use the clear ip ospf statistics command to clear the event statistics from one or more OSPF instances. If you do not specify the instance-tag argument, Cisco NX-OS clears statistics from all OSPF instances. Use the show ip ospf statistics command to to view the statistics that you are clearing.

This command requires the LAN Base Services license.

Examples

This example shows how to clear all OSPF event statistics:

switch# clear ip ospf statistics
 
   

Related Commands

Command
Description

show ip ospf statistics

Displays event statistics for OSPF.


clear ip ospf traffic

To clear Open Shortest Path First (OSPF) traffic statistics, use the clear ip ospf traffic command.

clear ip ospf [instance-tag] traffic [interface] [vrf vrf-name]

Syntax Description

instance-tag

(Optional) Instance tag. Specify as an alphanumeric string of up to 20 characters.

interface

(Optional) Interface to clear traffic statistics for. Use the ? option to see the interface options.

vrf vrf-name

(Optional) Specifies the name of the OSPF virtual routing and forwarding (VRF) instance. The vrf-name argument can be any alphanumeric string of up to 32 characters, except "default" and "all".


Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

Use the clear ip ospf traffic command to clear the traffic statistics from one or more OSPF instances. If you do not specify the instance-tag argument, Cisco NX-OS clears traffic statistics from all OSPF instances. Use the show ip ospf traffic statistics command to view the statistics that you are clearing.

This command requires the LAN Base Services license.

Examples

This example shows how to clear OSPF traffic statistics for OSPF 100:

switch# clear ip ospf 100 traffic
 
   

Related Commands

Command
Description

show ip ospf traffic statistics

Displays OSPF traffic statistics.


clear ip traffic

To clear IP traffic information, use the clear ip traffic command.

clear ip traffic

Syntax Description

This command has no arguments or keywords.

Command Default

None

Command Modes

Command HistoryAny command mode

Release
Modification

5.0(3)N1(1)

This command was introduced.


Examples

This example shows how to clear the IP traffic information:

switch(config)# clear ip traffic
 
   

Related Commands

Command
Description

show ip traffic

Displays IP traffic information.