OSPF routing protocol is a large-scale routing protocol highly used by enterprises. OSPF is an internal gateway protocol based on link-state, which is widely used in enterprise and ISP networking. I will mainly analyse the shortcomings of the OSPF routing protocol and the security risks and preventive measures of the Dijkstra algorithm used by OSPF itself, and propose some targeted suggestions for enhancing the security and stability of the OSPF protocol.