OSPF Commands
protocol ospf no protocol ospf Enables Open Shortest Path First Protocol (OSPF), and unhides the related OSPF commands. The no form of the command deletes the OSPF configuration and hides the OSPF related commands. |
||
Syntax Description |
N/A |
|
Default |
Disabled |
|
Configuration Mode |
config |
|
History |
3.3.3500 |
|
Example |
switch (config)# protocol ospf |
|
Related Commands |
ip routing |
|
Notes |
router ospf [<process-id> [vrf <vrf-name>]] no router ospf [<process-id> [vrf <vrf-name>]] Creates an ospf instance in the specified VRF and enters the ospf configuration mode. The default process ID is 1 If a VRF is not specified, the OSPF instance is created in the default VRF. |
||
Syntax Description |
process-id |
OSPF instance ID |
vrf |
VRF name (e.g. default) |
|
Default |
Process ID – 1 VRF – active VRF routing-context |
|
Configuration Mode |
config |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF and process ID parameters and updated Example |
|
Example |
switch (config)# router ospf 2 vrf myvrf |
|
Related Commands |
||
Notes |
Only one OSPF instance per VRF is supported. |
router-id <ip-address> no router-id Sets Router ID for the OSPF instance. The no form of the command causes automatic election of router ID by the router. |
||
Syntax Description |
ip-address |
The Router ID in IP address format |
Default |
The router ID is a 32-bit number assigned to the router running the OSPF protocol. This number uniquely identifies the router within an OSPF link-state database. Router ID can be configured statically. However, if it is not configured, then the default election is as follows:
|
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
3.7.1100 |
Updated default |
|
Example |
switch (config router ospf)# router-id 10.10.10.10 |
|
Related Commands |
||
Notes |
shutdown no shutdown Disables the OSPF instance. The no form of the command enables the OSPF instance. |
||
Syntax Description |
N/A |
|
Default |
Enable (no shutdown) |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# shutdown |
|
Related Commands |
||
Note |
auto-cost reference-bandwidth <ref-bw> [Gbps | Mbps] no auto-cost reference-bandwidth Configures reference-bandwidth in Gb/s (Default) or Mb/s. The no form of the command resets this parameter to its default value. |
||
Syntax Description |
ref-bw |
Range: 1-4294 |
Gbps |
Value in Gb/s (default if not specified) |
|
Mbps |
Value in Mb/s |
|
Default |
100Gbps |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# auto-cost reference-bandwidth 10 Gbps |
|
Related Commands |
||
Notes |
distance <value> no distance Configures the OSPF route administrative distance. The no form of the command resets this parameter to default. |
||
Syntax Description |
value |
OSPF administrative distance Range is 1-255 |
Default |
110 |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# distance 100 |
|
Related Commands |
||
Notes |
redistribute {bgp | direct | static | ebgp | ibgp} no redistribute {bgp | direct | rip | static} Enables importing routes from other routing protocols as well as any statically configured routers into OSPF. The no form of the command disables the importing of the routes. |
||
Syntax Description |
direct |
Redistributes directly connected routes |
bgp |
Redistributes routes from BGP protocol |
|
ibgp |
Redistributes IBGP routes |
|
ebgp |
Redistributes EBGP routes |
|
static |
Redistributes static configured routes |
|
Default |
Disable (no redistribution) |
|
Configuration Mode |
config ospf router |
|
History |
3.6.3506 |
|
Example |
switch (config router ospf)# redistribute direct |
|
Related Commands |
||
Notes |
Routes from multiple protocols can be imported in parallel. |
timers throttle spf <spf-delay> <spf-hold> no timers throttle spf Sets the OSPF throttle SPF timers. The no form of the command resets the timers to default. |
||
Syntax Description |
spf-delay |
The interval by which SPF calculations delayed after a topology change reception Range: 0-100 (milliseconds) |
spf-hold |
The minimum delay between two consecutive delay calculations Range: 0-1000 (milliseconds) |
|
Default |
spf-delay – 1 millisecond spf-hold – 10 milliseconds |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# timers throttle spf 100 1000 |
|
Related Commands |
||
Notes |
area <area-id> default-cost <cost> no area <area-id> default-cost Specifies cost for the default summary route sent into an OSPF stub or not-so-stubby area (NSSA). The no form of the command sets the cost to the default value. |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295. |
cost |
The cost for the default summary route Range: 1-16777215. |
|
Default |
The summary route cost is based on the area border router that generated the summary route |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# area 0 default-cost 100 |
|
Related Commands |
||
Notes |
Base cost for all calculation is 100GbE |
area <area-id> range <ip-address> <prefix> [not-advertise] no area <area-id> range <ip-address> <prefix> [not-advertise] Consolidates and summarizes routes at an OSPF area boundary. The no form of the command removes the ip-prefix range from summarization. |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295 |
not-advertise |
Suppresses routes that match the specified IP address |
|
prefix |
Network prefix (in the format of /24, or 255.255.255.0 for example) |
|
Default |
Disabled |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# area 0 range 10.10.10.10 /24 |
|
Related Commands |
||
Notes |
area <area-id> stub [no-summary] no area <area-id> stub [no-summary] Configures an area as an OSPF stub area (an area is created if non-existent). The no form of the command removes the stub area configuration and changes the area to normal, or deletes the area (if stub is not used). |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295 |
no-summary |
Summary route will not be advertised into the stub area |
|
Default |
Summary route is advertised |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# area 0 stub |
|
Related Commands |
||
Note |
area <area-id> nssa [default-information-originate [metric <m-value>] [metric-type <m-type>]] [nosummary] [translate type7 always] no area <area-id> nssa [default-information-originate ] [no-summary] [translate type7 always] Configures an area as an OSPF not-so-stubby (NSSA) area. The no form of the command removes the NSSA area configuration and changes the area to default. |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295 |
default-information-originate |
A default type7 LSA (Link State Advertisements) is generated into the NSSA area |
|
m-type |
Metric type for OSPF Range: 1-2 |
|
m-value |
Metric value for OSPF Range: 1-65535 |
|
no-summary |
Summary route will not be advertised into the NSSA area |
|
translate type7 always |
Type7 LSAs is translated to type5 LSAs (Link State Advertisements) |
|
Default |
Default m-type – 2 Default m-value – 10 |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# area 0 nssa |
|
Related Commands |
||
Notes |
An area can be either stub, NSSA or normal. |
no area <area-id> Deletes OSPF area and its related configuration. |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295 |
Default |
N/A |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# no area 1 |
|
Related Commands |
||
Notes |
The command fails if the area is attached to active interfaces |
default-information originate [always] [metric <m-value>] [metric-type <m-type>] no default-information originate Enables default route origination to normal areas. The no form of the command resets the parameter values to their default. |
||
Syntax Description |
always |
Default route is always advertised even if the default route is not in the routing table |
metric |
Route metric value. Range: 1-65535. |
|
metric-type |
Metric type. Range: 1-2. |
|
Default |
m-value – 1 m-type – 2 |
|
Configuration Mode |
config ospf router |
|
History |
3.6.8008 |
|
Example |
switch (config router ospf)# default-information originate always |
|
Related Commands |
||
Notes |
When default route origination is enabled, the router automatically becomes ASBR and advertises a default route |
summary-address <ip-address> <prefix> [not-advertise] no summary-address <ip-address> <prefix> [not-advertise] Creates aggregate addresses for the OSPF protocol. The no form of the command disables the aggregation of the ip-address. |
||
Syntax Description |
ip-address |
The summary IP address. |
not-advertise |
Suppresses routes that match the specified ip-address. |
|
prefix |
Network prefix (in the format of /24 or 255.255.255.0, for example). |
|
Default |
N/A |
|
Configuration Mode |
config ospf router |
|
History |
3.3.3500 |
|
Example |
switch (config router ospf)# summary-address 10.10.10.10 /24 |
|
Related Commands |
||
Notes |
Maximum of 1500 summarized IP addresses can be configured |
ip ospf cost <cost> no ip ospf cost Sets OSPF cost of sending packet of this interface. The no form of the command resets this parameter to default. |
||
Syntax Description |
cost |
The Interface cost used by the OSPF. Range is 1-65535. |
Default |
Reference_BW/Link_BW |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
3.7.1100 |
Updated Default |
|
Example |
switch (config interface vlan 10)# ip ospf cost 100 |
|
Related Commands |
||
Notes |
ip ospf dead-interval <seconds> no ip ospf dead-interval Configures the interval during which at least one Hello packet must be received from a neighbor before the router declares that neighbor as down. The no form of the command resets this parameter to its default. |
||
Syntax Description |
seconds |
The dead-interval timer Range: 1-65535 seconds |
Default |
40 seconds |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf dead-interval 10 |
|
Related Commands |
||
Notes |
The value must be the same for all nodes on the network. |
ip ospf hello-interval <seconds> no ip ospf hello-interval Configures the interval between Hello packets that OSPF sends on the interface. The no form of the command resets this parameter to default. |
||
Syntax Description |
seconds |
The Hello interval timer Range: 1-65535 seconds |
Default |
10 |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf hello-interval 20 |
|
Related Commands |
||
Notes |
The value must be the same for all nodes on the network. |
ip ospf priority <number> no ip ospf priority Configures the priority for this OSPF interface. The no form of the command resets this parameter to default. |
||
Syntax Description |
number |
The Interface priority used by the OSPF protocol Range: 0-255 |
Default |
1 |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf priority 100 |
|
Related Commands |
||
Notes |
|
ip ospf network <type> no ip ospf network Sets the OSPF interface network type. The no form of the command resets the interface network type to its default. |
||
Syntax Description |
type |
The network type on this interface.
|
Default |
Broadcast for VLAN interfaces Point-to-point for router port interfaces |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf network point-to-point |
|
Related Commands |
||
Notes |
|
ip ospf retransmit-interval <seconds> no ip ospf retransmit-interval Configures the time between OSPF link-state advertisement (LSA) retransmissions for adjacencies that belongs to the interface. The no form of the command resets this parameter to its default. |
||
Syntax Description |
seconds |
The retransmit interval Range: 0-3600 seconds |
Default |
5 |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf retransmit-interval 10 |
|
Related Commands |
||
Notes |
ip ospf passive-interface no ip ospf passive-interface Suppresses flooding of OSPF routing updates on an interface. The no form of the command reverts the status to active OSPF interface. |
||
Syntax Description |
N/A |
|
Default |
Active interface (no ip ospf passive-interface) |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf passive-interface |
|
Related Commands |
||
Notes |
ip ospf transmit-delay <seconds> no ip ospf transmit-delay Sets the estimated time required to send an OSPF link-state update packet. The no form of the command resets this parameter to its default. |
||
Syntax Description |
seconds |
The transmit-delay interval in seconds Range: 0-3600 |
Default |
1 |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf transmit-delay 2 |
|
Related Commands |
||
Notes |
ip ospf shutdown no ip ospf shutdown Disables the OSPF instance on the interface. The no form of the command enables the OSPF on this interface. |
||
Syntax Description |
N/A |
|
Default |
Enabled (no shutdown) |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf shutdown |
|
Related Commands |
||
Notes |
ip ospf authentication [message-digest] no ip ospf authentication Specifies the authentication type for OSPF. The no form of the command disables the authentication. |
||
Syntax Description |
message-digest |
Specifies that message-digest authentication (MD5) is used |
Default |
Disabled |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf authentication |
|
Related Commands |
||
Notes |
|
ip ospf authentication-key [<auth-type>] <password> no ip ospf authentication-key To assign a password for simple password authentication for the OSPF. The no form of the command deletes the simple password authentication key. |
||
Syntax Description |
auth-type |
The authentication type:
|
password |
Authentication password (up to 8 alphanumeric string) |
|
Default |
Unencrypted password |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf authentication-key 0 mycleartextpassword |
|
Related Commands |
||
Notes |
|
ip ospf message-digest-key <key-id> md5 [auth-type] <key> no ip ospf message-digest-key <key-id> Sets the message digest key for MD5 authentication. The no form of the command deletes the key for MD5 authentication. |
||
Syntax Description |
auth-type |
The authentication type:
|
key |
Authentication password, up to 8 alphanumeric string |
|
key-id |
Alphanumeric password of up to 16 bytes |
|
Default |
Unencrypted |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf message-digest-key mykeyid md5 7 mykey |
|
Related Commands |
||
Notes |
The user cannot delete the last key until authentication is disabled. |
ip ospf area <area-id> no ip ospf area Configures OSPF area of this interface (and creates the area if non-existent). The no form of the command removes the interface from the area. |
||
Syntax Description |
area-id |
OSPF area ID Range: 0-4294967295 |
Default |
N/A |
|
Configuration Mode |
config interface vlan config interface ethernet (configured as a router port interface) config interface port-channel (configured as a router port interface) config interface loopback |
|
History |
3.3.3500 |
|
Example |
switch (config interface vlan 10)# ip ospf area 0 |
|
Related Commands |
||
Notes |
show ip ospf [<process-id> [vrf <vrf-name>]] Displays general OSPF configuration on specific VRF and status. |
||
Syntax Description |
process-id |
OSPF instance ID |
vrf |
VRF instance |
|
Default |
Process ID – 1 VRF – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF and process ID parameters and updated Example |
|
Example |
||
switch (config)# show ip ospf 2 vrf myvrf |
||
Related Commands |
||
Notes |
show ip ospf border-routers [vrf <vrf-name>] Displays routing table entries to an Area Border Routers. |
||
Syntax Description |
vrf |
OSPF routing table entries to an Area Border Routers on specific VRF |
Default |
VRF – a ctive VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF parameter and updated Example |
|
Example |
||
switch (config)# show ip ospf border-routers vrf myvrf OSPF Process ID 2, vrf myvrf Internal Routing Table |
||
Related Commands |
||
Notes |
show ip ospf database [summary] [<process-id> <area-id> [<link-state-id>]] [adv-router <ip-address> | self-originated] [vrf <vrf-name>] Displays the OSPF database. |
||
Syntax Description |
adv-router <ip-address> |
Filters per advertise router |
area-id |
Filters the command per OSPF area ID Range: 0-4294967295 |
|
link-state-id |
The link state ID |
|
self-originated |
Self Originate |
|
summary |
Summarizes the output of the OSPF database |
|
process-id |
Displays OSPF database on specific instance ID |
|
vrf |
Displays OSPF database on specific VRF |
|
Default |
Process ID – 1 VRF – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF and process ID parameters and updated Example |
|
Example |
switch (config)# show ip o |
|
Related Commands |
||
switch (config)# show ip ospf database 2 vrf myvrf OSPF Router with ID (2.2.2.2) (Process ID 2 VRF myvrf) |
||
Notes |
show ip ospf interface [<process-id>] [vlan <vlan-id> | Ethernet <slot/port | port-channel <number>] [brief] Displays the OSPF related interface configuration. |
||
Syntax Description |
brief |
Gives a brief summary of the output |
process-id |
Displays OSPF interface configuration on specific instance ID |
|
vlan <vlan-id> |
Displays OSPF interface configuration and status per VLAN interface |
|
vrf |
Displays OSPF interface configuration on specific VRF |
|
Default |
Process ID – 1 VRF – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF and process ID parameters and updated Example |
|
3.6.4070 |
Added Ethernet variable |
|
Example |
||
switch (config) # show ip ospf interface 2 vrf myvrf |
||
Related Commands |
||
Notes |
show ip ospf [vrf <vrf-name>] neighbors [vlan <vlan-id> | interface <name>] [<neighbor ip address>] Displays the OSPF related interface neighbor configuration. |
||
Syntax Description |
vlan-id |
Displays OSPF interface configuration and status per VLAN interface |
neighbor ip address |
Filers the output per a specific OSPF neighbor |
|
vrf |
Displays OSPF interface neighbor configuration on specific VRF |
|
Default |
VRF – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
3.6.1002 |
Added VRF parameter and updated Example |
|
3.6.4070 |
Added support for BFD |
|
Example |
||
switch (config) # show ip ospf neighbors vrf myvrf Neighbor 1.1.1.1, interface address 21.21.21.1 |
||
Related Commands |
||
Notes |
BFD session state is displayed as: established, failed or not established. When BFD is not defined in the command, it is not displayed in the output. |
show ip ospf request-list <neighbor-id> {vlan <vlan-id> | ethernet <slot/port> | port-channel <id>} [vrf <vrf-name>] Displays the OSPF list of all link-state advertisements (LSAs) requested by a router. |
||
Syntax Description |
neighbor-id |
Filers the output per a specific OSPF neighbor |
vlan-id |
Filers the output per a specific VLAN ID |
|
vrf <vrf-name> |
Displays OSPF request-list on specific VRF |
|
Default |
vrf – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
Example |
||
switch (config) # show ip ospf request-list 4.4.4.4 vlan 7 OSPF Router with ID (7.7.7.1) (Process ID 1) |
||
Related Commands |
||
Notes |
show ip ospf retransmission-list <neighbor-id> {vlan <vlan-id> | ethernet <slot/port> | port-channel <id>} [vrf <vrf-name>] Displays the OSPF list of all link-state advertisements (LSAs) waiting to be resent to neighbors. |
||
Syntax Description |
neighbor-id |
Filers the output per a specific OSPF neighbor |
vrf <vrf-name> |
Displays OSPF retransmission-list on specific VRF |
|
vlan-id |
Filers the output per a specific VLAN ID |
|
Default |
vrf – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
Example |
||
switch (config) # show ip ospf retransmission-list 4.4.4.4 vlan 6 OSPF Router with ID (7.7.7.1) (Process ID 1) |
||
Related Commands |
||
Notes |
show ip ospf summary-address [vrf <vrf-name>] Displays a list of all summary address redistribution information configured on the OSPF. |
||
Syntax Description |
vrf <vrf-name> |
Display summary address and area range information on specific VRF |
Default |
vrf – active VRF routing-context |
|
Configuration Mode |
Any command mode |
|
History |
3.3.3500 |
|
Example |
||
switch (config)# show ip ospf summary-address |
||
Related Commands |
||
Notes |