Adjacencies

Peering

General information on “OSPF Peering”:

Instance ID value Description
0 IPv6 unicast AF default instance
1-31 IPv6 unicast AF configurable instance
32 IPv6 multicast AF default instance
33-63 IPv6 multicast AF configure instance
64 IPv4 unicast AF default instance
65-95 IPv4 unicast AF configurable instance
96 IPv4 multicast AF default instance
97-127 IPv4 multicast AF configure instance
128-255 Unassigned
- Important: IOS 15.x/IOS-XE 16.x and 17.x support only one configured OSPF process per interface.

OSPF configuration considerations:

“OSPF Peering” CLI configuration commands:

## ======
## OSPFv2
## ======

## Configuring an OSPFv2 process
Router(config)# router ospf <pid>
Router(config-router)# network <network> <mask> area <id>

## Configuring OSPFv2 on a per-interface basis
Router(config)# interface <if>
Router(config-if)# ip ospf <pid> area <id>


## ======
## OSPFv3
## ======

## Configuring an OSPFv3 process
Router(config)# ipv6 unicast-routing

Router(config)# router ospfv3 <pid>
Router(config-router)# address-family [ipv4 | ipv6] unicast [vrf [VRF-NAME]]
Router(config-router-af)# [argument]

## Configuring OSPFv3 on a per-interface basis
Router(config)# ipv6 unicast-routing

Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> [ipv4 | ipv6] area <id> [instance <id>]

“OSPF Peering” CLI show commands:

## ======
## OSPFv2
## ======

## Showing all OSPFv2 neighbors
Router# show ip ospf neighbor

## Showing the OSPFv2 databases
Router# show ip ospf database

## Showing all OSPFv2 interfaces
Router# show ip ospf interface brief

## Showing a specific OSPFv2 interface in detail
Router# show ip ospf interface <if>


## ======
## OSPFv3
## ======

## Showing all OSPFv3 neighbors
Router# show ospfv3 [ipv4 | ipv6] neighbor

## Showing the OSPFv3 databases
Router# show ospfv3 [ipv4 | ipv6] database

## Showing all OSPFv3 interfaces
Router# show ospfv3 [ipv4 | ipv6] interface brief

## Showing a specific OSPFv3 interface in detail
Router# show ospfv3 [ipv4 | ipv6] interface <if>

Multicast

General information on “OSPF Multicast”:

Unicast

General information on “OSPF Unicast”:

“OSPF Unicast” CLI configuration commands:

## ======
## OSPFv2
## ======

## Configuring a unicast neighbor in OSPFv2:
Router(config)# router ospf <pid>
Router(config-router)# neighbor <ip>


## ======
## OSPFv3
## ======

## Configuring a unicast neighbor in OSPFv3 for both address families:
Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> neighbor <ipv6-link-local>

## Configuring a unicast neighbor in OSPFv3 for a specific address family:
Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> [ipv4 | ipv6] neighbor <ipv6-link-local>

Authentication

General information on “OSPF Authentication”:

“OSPF Authentication” CLI configuration commands:

## ======
## OSPFv2
## ======

## Configuring clear-text authentication without a key-chain for OSPFv2 globally
Router(config)# router ospf <pid>
Router(config-router)# area <id> authentication

Router(config)# interface <if>
Router(config-if)# ip ospf authentication-key <key>

## Configuring cryptographic authentication with a key-chain for OSPFv2 globally
Router(config)# router ospf <pid>
Router(config-router)# area <id> authentication message-digest

Router(config)# key chain <name>
Router(config-keychain)# key <number>
Router(config-keychain-key)# key-string <string>
Router(config-keychain-key)# cryptographic-algorithm <algorithm>

Router(config)# interface <if>
Router(config-if)# ip ospf authentication key-chain [NAME]

## Disabling authentication for OSPFv2 on a per-interface basis
Router(config)# interface <if>
Router(config-if)# ip ospf authentication null

## Configuring clear-text authentication without a key-chain for OSPFv2 on a per-interface basis
Router(config)# interface <if>
Router(config-if)# ip ospf authentication
Router(config-if)# ip ospf authentication-key <key>

## Configuring cryptographic authentication with a key-chain for OSPFv2 on a per-interface basis
Router(config)# key chain <name>
Router(config-keychain)# key <number>
Router(config-keychain-key)# key-string <string>
Router(config-keychain-key)# cryptographic-algorithm <algorithm>

Router(config)# interface <if>
Router(config-if)# ip ospf authentication message-digest
Router(config-if)# ip ospf authentication key-chain [NAME]


## ======
## OSPFv3
## ======

## Configuring IPsec (IPv6 auth header) authentication for OSPFv3 globally
Router(config)# router ospfv3 <pid>
Router(config-router)# area <id> authentication ipsec spi <value> [md5 | sha1] [0 | 7 | hex-string] <key>

## Configuring cryptographic (OSPFv3 auth trailer) authentication with a key-chain for OSPFv3 globally
Router(config)# key chain <name>
Router(config-keychain)# key <number>
Router(config-keychain-key)# key-string <string>
Router(config-keychain-key)# cryptographic-algorithm <algorithm>

Router(config)# router ospfv3 <pid>
Router(config-router)# area <id> authentication key-chain [NAME]

## Disabling authentication for OSPFv3 on a per-interface basis for all processes
Router(config)# interface <if>
Router(config-if)# ospfv3 authentication null

## Disabling authentication for OSPFv3 on a per-interface basis for a specific process
Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> authentication null

## Configuring IPsec (IPv6 auth header) authentication for OSPFv3 on a per-interface basis for all processes
Router(config)# interface <if>
Router(config-if)# ospfv3 authentication ipsec spi <value> [md5 | sha1] [0 | 7 | hex-string] <key>

## Configuring IPsec (IPv6 auth header) authentication for OSPFv3 on a per-interface basis for a specific process
Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> authentication ipsec spi <value> [md5 | sha1] [0 | 7 | hex-string] <key>

## Configuring cryptographic (OSPFv3 auth trailer) authentication with a key-chain for OSPFv3 on a per-interface basis for all processes
Router(config)# key chain <name>
Router(config-keychain)# key <number>
Router(config-keychain-key)# key-string <string>
Router(config-keychain-key)# cryptographic-algorithm <algorithm>

Router(config)# interface <if>
Router(config-if)# ospfv3 authentication key-chain [NAME]

## Configuring cryptographic (OSPFv3 auth trailer) authentication with a key-chain for OSPFv3 on a per-interface basis for a specific process
Router(config)# key chain <name>
Router(config-keychain)# key <number>
Router(config-keychain-key)# key-string <string>
Router(config-keychain-key)# cryptographic-algorithm <algorithm>

Router(config)# interface <if>
Router(config-if)# ospfv3 <pid> authentication key-chain [NAME]

Encryption

General information on “OSPFv3 Encryption”:

“OSPF Encryption” CLI configuration commands:

## ======
## OSPFv3
## ======

## Configuring IPsec encryption  (IPv6 ESP header) for the whole OSPFv3 process:
Router(config)# router ospfv3 <pid>
Router(config-if)# area <area> encryption spi <value> esp [3des | aes-cbc | des | null] [arguments]

## Configuring IPsec encryption  (IPv6 ESP header) for OSPFv3 on a per-interface basis:
Router(config)# interface <if>
Router(config-if)# ospfv3 encryption spi <value> esp [3des | aes-cbc | des | null] [arguments]

## Disabling IPsec encryption  (IPv6 ESP header) for OSPFv3 on a per-interface basis:
Router(config)# interface <if>
Router(config-if)# ospfv3 encryption null

Summarization

General information on “OSPF Summarization”:

“OSPF Summarization” CLI configuration commands:

## ======
## OSPFv2
## ======

## Configuring ABR summarization in OSPFv2
Router(config)# router ospf <pid>
Router(config-router)# area <id> range <prefix> <mask> [cost <cost> | not-advertise]

## Configuring ASBR summarization in OSPFv2
Router(config)# router ospf <pid>
Router(config-router)# summary-address <prefix> <mask> [not-advertise | nssa-only | tag]


## ======
## OSPFv3
## ======

## Configuring ABR summarization in OSPFv3
Router(config)# router ospfv3 <pid>
Router(config-router)# address-family [ipv4 | ipv6] unicast [vrf [VRF-NAME]]
Router(config-router-af)# area <id> range <prefix> <mask> [cost <cost> | not-advertise]

## Configuring ASBR summarization in OSPFv3
Router(config)# router ospfv3 <pid>
Router(config-router)# address-family [ipv4 | ipv6] unicast [vrf [VRF-NAME]]
Router(config-router-af)# summary-prefix <prefix> <mask> [not-advertise | nssa-only | tag]