> For the complete documentation index, see [llms.txt](https://paul-gleason.gitbook.io/cisco-ios-cheat-sheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paul-gleason.gitbook.io/cisco-ios-cheat-sheet/subsection/ospf.md).

# OSPF

### Base Setup

```
enable
config t
interface {interface} {interface_#}
no shutdown
ip address {ip_address} {subnet}
router ospf 1
network {network_address} {wildcard} area {area_#}
```

Example

```
enable
config t
interface GigabitEthernet 0/0
no shutdown
ip address 10.8.1.1 255.255.255.248
router ospf 1
network 10.8.1.0 0.0.0.7 area 0
```

### Add Authentication&#x20;

#### MD5:

[Documentation](https://networklessons.com/ospf/how-to-configure-ospf-md5-authentication)

```
enable 
config t 
interface {interface} {interface #} 
ip ospf message-digest-key {instance #} md5 {password}
ip ospf authentication message-digest
```

Example:

```
enable 
config t 
interface GigabitEthernet 0/0 
ip ospf message-digest-key 1 md5 testing 
ip ospf authentication message-digest
```

Verification:

```
enable
show ip ospf interface fastEthernet 0/0
```

Output:

<figure><img src="/files/ZYkpHznNt7R4a2fAcvpV" alt=""><figcaption><p>Verification Output</p></figcaption></figure>

#### SHA-512:

[Documentation](https://networklessons.com/cisco/ccie-routing-switching-written/ospf-hmac-sha-extended-authentication)

```
enable
config t
key chain {key_name}
key {#}
cryptographic-algorithm {algorithm}
key-string {password}
exit
interface {interface} {interface_#}
ip ospf authentication key-chain {key_name}
```

Example:

```
enable
config t
key chain R2
key 1
cryptographic-algorithm hmac-sha-512
key-string testing
exit
interface GigabitEthernet 0/1
ip ospf authentication key-chain R2
```

Verification:

```
enable
show ip ospf interface GigabitEthernet 0/1 | begin auth
```

Output:

<figure><img src="/files/heHoCXoFG6bpFpvsMRah" alt=""><figcaption><p>Verification Output</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://paul-gleason.gitbook.io/cisco-ios-cheat-sheet/subsection/ospf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
