Similar to using the shutdown command on an interface, there is also a shutdown command for OSPF. This allows you to gracefully stop the OSPF routing process without removing the configuration from your router. You can do this globally or on the interface level.
If you want to do a graceful shutdown globally, you have to use the shutdown command under the OSPF process. This will:
- Drop all neighbor adjacencies
- Flush all LSAs that the router originated by setting the age to 3600 seconds
- Send hello packets with the DR/BDR set to 0.0.0.0 and an empty neighbor list. This will trigger other OSPF routers to fall back to init state.
- Stop sending/receiving OSPF packets.
If you shut OSPF on the interface level with the ip ospf shutdown command, it will do this:
- Drop all neighbor adjacencies on the interface you selected.
- Flood updated LSAs where all information (prefix, neighbors) from the selected interface is removed.
- Send hello packets with the DR/BDR set to 0.0.0.0 and an empty neighbor list. This will trigger other OSPF router to fall back to init state.
- Stop sending/receiving OSPF packets.
Configuration
Let’s look at this in action. I will use these two routers that are running OSPF:

Right now, these two routers are OSPF neighbors:
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.12.2 1 FULL/BDR 00:00:39 192.168.12.2 GigabitEthernet0/1
Let’s shut the OSPF process on R1:
R1(config)#router ospf 1
R1(config-router)#shutdown
OSPF is no longer running so the neighbor adjacency will drop:
R1#
%OSPF-5-ADJCHG: Process 1, Nbr 192.168.12.2 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
R1#show ip ospf neighbor
If you look at the interface level, you will still see some OSPF details:
R1#show ip ospf interface GigabitEthernet 0/1
GigabitEthernet0/1 is up, line protocol is up
Internet Address 192.168.12.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 192.168.13.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State DOWN, Priority 1
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
As expected, our configuration is still in the running config:
R1#show running-config | begin ospf
router ospf 1
shutdown
network 192.168.12.0 0.0.0.255 area 0
That’s all there is to it.
- Configurations
- R1
- R2
Unit 1: Introduction to OSPF
- Introduction to OSPF
- Basic OSPF Configuration
- OSPF Multi Area Configuration
- OSPF Reference Bandwidth
- OSPF Plain Text Authentication
- OSPF MD5 Authentication
- OSPF SHA-HMAC Authentication
- OSPF TTL Security Check
- OSPF Default Route
Unit 2: OSPF Neighbor Adjacency
- OSPF LSA Types
- OSPF LSAs and LSDB Flooding
- OSPF Hello and Dead Interval
- OSPF Router ID
- OSPF Packets and Neighbor Discovery
- OSPF DR/BDR Election
- OSPF Passive Interface
- Troubleshooting OSPF Neighbor Adjacency
Unit 3: OSPF Network Types
- OSPF Non-Broadcast Network Type
- OSPF Broadcast Network Type
- OSPF Point-to-Multipoint Network Type
- OSPF Point-to-Multipoint Non-Broadcast Network Type
- OSPF Point-to-Point Network Type
- OSPF Next Hop with Network Types
Unit 4: OSPF Stub Areas
- Introduction to OSPF Stub Areas
- How to configure OSPF Stub Area
- How to configure OSPF Totally Stub
- How to configure OSPF NSSA (Not So Stubby) Area
- How to configure OSPF Totally NSSA (Not So Stubby) Area
- OSPF NSSA P-bit explained
Unit 5: Advanced OSPF Topics
- OSPF Summarization
- OSPF Distribute-List Filtering
- OSPF LSA Type 3 Filtering
- OSPF LSA Type 5 Filtering
- OSPF Virtual Link
- OSPF Virtual Link Authentication
- OSPF Path Selection Explained
- How to read the OSPF Database
- OSPFv3 for IPv4
- Troubleshooting OSPF Route Advertisement
- OSPF SPF Scheduling and Throttling
- OSPF LSA Throttling
- OSPF Incremental SPF
- OSPF Prefix Suppression
- OSPF Stub Router
- OSPF Graceful Shutdown
- OSPF Graceful Restart
- OSPF Loop-Free Alternate (LFA) Fast Reroute (FRR)
- OSPF Remote Loop-Free Alternate (LFA) Fast Reroute (FRR)