1>》在R1和R2上分别开启OSPF进程
2》在R1上配置认证密码
R1(config-if)#ip ospf authentication-key cisco
3》在R2上配置认证密码
R2(config-if)#ip ospf authentication-key cisco
4》实验调试
◆R1#show ip ospf interface s0/3/0
Serial0/3/0 is up, line protocol is up
Internet address is 192.168.12.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT-TO-POINT, Cost: 781
Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1 , Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
Simple password authentication enabled 这一行信息表明该接口启用了简单口令认证。
◆R1#show ip ospf
Routing Process "ospf 1" with ID 1.1.1.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 2
Area has simple password authentication 这一行表明区域0采用了简单口令认证。
SPF algorithm executed 2 times
Area ranges are
Number of LSA 2. Checksum Sum 0x00dc42
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
注意:如果一边开启了简单口令认证一边没有则在此区域,OSPF协议不能正常工作,或者两边密码不一致也是一样的,这个大家可以进行简单的验证。
谢谢大家!!
转载于:https://blog.51cto.com/xuzhiming302/531913