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
Want to take a look for yourself? Here you will find the final configuration of each device.
R1
hostname R1
!
ip cef
!
interface GigabitEthernet0/1
ip address 192.168.12.1 255.255.255.0
!
router ospf 1
shutdown
network 192.168.12.0 0.0.0.255 area 0
!
end
R2
hostname R2
!
ip cef
!
interface GigabitEthernet0/1
ip address 192.168.12.2 255.255.255.0
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
!
end
Hi Rene,
In which situation we can use this command?? Actually I cant find out the importance of this command in my view. Could you please tell me the uses of this command?? Thx
br//
zaman
Hello zaman
According to Cisco:
Essentially, the advantage here is that the router that is being shutdown will send out messages to other OSPF routers informing them of the shut
... Continue reading in our forumHi,
Still bit confusion,Exactly, when we are going to use Graceful shutdown…? Possiblity situations?
Hello mohsin.
Graceful shutdown for OSPF is useful when you want to remove or disable a router (for maintenance purposes for example) in the least disruptive manner. What it does is it lets other routers know about its intentions and gives an opportunity to the other routers to find alternative routes to their destinations. This way, when the router is actually shut down, rerouting has already been established and end users should detect little or no change in the network performance.
I hope this has been helpful!
Laz
Hi Laz-
Brilliant explaination !!!
This is what I’m looking for…
Thanks! by the way, if anything i’ll let u know…