clear ip ospf

Clears OSPF data processes, counters, neighbors, or routes.

Syntax

clear ip ospf all [ vrf vrf-name ]
clear ip ospf counters { all | ethernet slot/port | loopback number | port-channel number | ve vlan_id } [ vrf vrf-name ]
clear ip ospf neighbor { ip-addr | all } [ vrf vrf-name ]
clear ip ospf routes { ip-addr/mask | all } [ vrf vrf-name ]

Parameters

all
Clears all OSPF data processes.
vrf name
Specifies a VRF.
counters
Clears OSPF counters.
all
Clears all counters.
ethernet slot / port
Specifies an Ethernet slot and port.
loopback number
Specifies a loopback interface. Valid values range from 1 through 255.
port-channel number
Specifies a port-channel.
ve vlan_id
Specifies a virtual Ethernet (VE) interface. Valid values range from 1 through 4096.
neighbor
Clears neighbors.
ip-addr
Specifies the IP address of the neighbor.
all
Clears all neighbors.
routes
Clears matching routes or clears all routes.
ip-addr/mask
Clears all routes that match the prefix and mask that you specify.
all
Clears all routes.

Modes

Privileged EXEC mode

Examples

The following example restarts the OSPF processes.

device# clear ip ospf all