IP Routing: OSPF Commands

ip ospf area

To enable Open Shortest Path First version 2 (OSPFv2) on an interface, use the ip ospf area command in interface configuration mode. To disable OSPFv2 on the interface, use the no form of this command.

ip ospf process-id area area-id

no ip ospf process-id area [area-id]

Syntax Description

process-id

A decimal value in the range from 1 to 65535 that identifies the process ID.

area-id

A decimal value in the range from 0 to 4294967295, or an IP address in the dotted-decimal format.

Command Default

None

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf area.

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf 65535 area 1

ip ospf authentication

To specify the authentication type for an interface, use the ip ospf authentication command in interface or virtual network interface configuration mode. To remove the authentication for an interface, use the no form of this command.

ip ospf authentication message-digest

no ip ospf authentication

Syntax Description

message-digest

(Optional) Specifies that message-digest authentication is used.

Command Default

The authentication type for an interface is not configured.

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf authentication.

Examples

The following example shows how to enable message-digest authentication:

Device(config)# interface GigabitEthernet 1
Device (config-if)# ip ospf authentication message-digest

ip ospf cost

To explicitly specify the cost of sending a packet on an interface, use the ip ospf cost command in interface configuration mode. To reset the path cost to the default value, use the no form of this command.

ip ospf cost interface-cost

no ip ospf cost interface-cost

Syntax Description

interface-cost

Unsigned integer value expressed as the link-state metric. It can be a value in the range from 1 to 65535.

Command Default

No default cost is predefined.

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf cost.

Device(config)# interface GigabitEthernet 1                                                                                          
Device(config-if)# ip ospf cost 65

ip ospf dead-interval

To set the interval during which at least one hello packet must be received from a neighbor before the router declares that neighbor down, use the ip ospf dead-interval command in interface configuration mode. To restore the default value, use the no form of this command.

ip ospf dead-interval seconds

no ip ospf dead-interval

Syntax Description

seconds

Interval (in seconds) during which the router must receive at least one hello packet from a neighbor or else that neighbor is removed from the peer list and does not participate in routing. The range is 1 to 65535. The value must be the same for all nodes on the network.

Command Default

seconds : Four times the interval set by the ip ospf hello-interval command.

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf dead-interval.

The following example sets the OSPF dead interval to 20 seconds:

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf dead-interval 20

ip ospf hello-interval

To specify the interval between hello packets that the Cisco IOS software sends on the interface, use the ip ospf hello-interval command in interface configuration mode. To return to the default time, use the no form of this command.

ip ospf hello-interval seconds

no ip ospf hello-interval

Syntax Description

seconds

Specifies the interval (in seconds). The value must be the same for all nodes on a specific network. The range is from 1 to 65535.

Command Default

10 seconds

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

This value is advertised in the hello packets. The smaller the hello interval, the faster topological changes will be detected, but more routing traffic will ensue. This value must be the same for all routers and access servers on a specific network.

The following example sets the interval between hello packets to 15 seconds:

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf hello-interval 15

ip ospf message-digest-key md5

To enable Open Shortest Path First (OSPF) Message Digest 5 (MD5) authentication, use the ip ospf message-digest-key md5 command in interface configuration mode. To remove an old MD5 key, use the no form of this command.

ip ospf message-digest-key key-id md5 key

no ip ospf message-digest-key

Syntax Description

key-id

An identifier in the range from 1 to 255.

key

Alphanumeric password of up to 16 characters.

Command Default

OSPF MD5 authentication is disabled.

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf message-digest-key md5.

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf message-digest-key 255 md5 7 00051105005E0D01072846

ip ospf network

To configure the Open Shortest Path First (OSPF) network type to a type other than the default for a given medium, use the ip ospf network command in interface configuration mode. To return to the default value, use the no form of this command.

ip ospf network broadcast

no ip ospf network

Syntax Description

broadcast

Sets the network type to broadcast.

Command Default

Depends on the network type.

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf network.

The following example sets your OSPF network as a broadcast network:

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf network broadcast

ip ospf priority

To set the router priority, which helps determine the designated router for this network, use the ip ospf priority command in interface configuration mode. The priority is valid only for broadcast interfaces.

To return to the default value, use the no form of this command.

ip ospf priority number-value

noip ospf priority

Syntax Description

number-value

A number value that specifies the priority of the router. The range is from 0 to 255.

Command Default

Priority of 1

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf priority.

The following example sets the router priority value to 4:

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf priority 4

ip ospf retransmit-interval

To specify the time between link-state advertisement (LSA) retransmissions for adjacencies belonging to the interface, use the ip ospf retransmit-interval command in interface configuration mode. To return to the default value, use the no form of this command.

ip ospf retransmit-interval seconds

no ip ospf retransmit-interval

Syntax Description

seconds

Time (in seconds) between retransmissions. The range is from 1 to 65535 seconds. The default is 5 seconds.

Command Default

5 seconds

Command Modes

Interface configuration (config-if)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For the usage guidelines, see ip ospf retransmit-interval.

The following example sets the retransmit interval value to 8 seconds:

Device(config)# interface GigabitEthernet 1
Device(config-if)# ip ospf retransmit-interval 8