在不中断邻接关系的情况下更换OSPF密钥

两台路由器R1 R2通过e0口直接相连,要求在不中断OSPF邻接关系的情况下更换OSPF密钥。

更换前:
R1#sh run int e0
Building configuration…
Current configuration : 100 bytes
!
interface Ethernet0
 ip address 1.1.1.1 255.255.255.0
 ip ospf message-digest-key 1 md5 cisco
end

R2#sh run int e0
Building configuration…
Current configuration : 140 bytes
!
interface Ethernet0
 ip address 1.1.1.2 255.255.255.0
 ip ospf message-digest-key 1 md5 cisco
 ip ospf message-digest-key 2 md5 PASS
end

更换时在R1上执行命令:
ip ospf message-digest-key 2 md5 PASS
no  ip ospf message-digest-key 1

R1#sh run int e0
Building configuration…
Current configuration : 100 bytes
!
interface Ethernet0
 ip address 1.1.1.1 255.255.255.0
 ip ospf message-digest-key 2 md5 PASS
end

R2#sh run int e0
Building configuration…
Current configuration : 140 bytes
!
interface Ethernet0
 ip address 1.1.1.2 255.255.255.0
 ip ospf message-digest-key 1 md5 cisco
 ip ospf message-digest-key 2 md5 PASS
end

 切换过程中debug ip ospf event可以看到如下信息:
R1(config-if)#ip ospf message-digest-key 2 md5 PASS
R1(config-if)#no  ip ospf message-digest-key 1
*Mar  1 19:47:54.487: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:47:54.491: OSPF: End of hello processing
*Mar  1 19:47:54.499: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:47:54.499: OSPF: End of hello processing
*Mar  1 19:47:59.323: OSPF: Send with youngest Key 2
*Mar  1 19:47:59.323: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:04.503: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:48:04.507: OSPF: End of hello processing
R1(config-if)#
R1#
*Mar  1 19:48:09.327: OSPF: Send with youngest Key 2
*Mar  1 19:48:09.327: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:09.475: %SYS-5-CONFIG_I: Configured from console by consolesh ip os nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.2           1   FULL/BDR        00:00:31    1.1.1.2         Ethernet0
R1#sh ip os nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.2           1   FULL/BDR        00:00:30    1.1.1.2         Ethernet0
R1#
*Mar  1 19:48:14.511: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:48:14.515: OSPF: End of hello processing
*Mar  1 19:48:19.331: OSPF: Send with youngest Key 2
*Mar  1 19:48:19.331: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:24.511: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:48:24.515: OSPF: End of hello processingsh ip os nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.2           1   FULL/BDR        00:00:36    1.1.1.2         Ethernet0
R1#sh ip os nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.2           1   FULL/BDR        00:00:35    1.1.1.2         Ethernet0
R1#sh ip os nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.2           1   FULL/BDR        00:00:35    1.1.1.2         Ethernet0
R1#
*Mar  1 19:48:29.335: OSPF: Send with youngest Key 2
*Mar  1 19:48:29.335: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:34.519: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:48:34.523: OSPF: End of hello processing
*Mar  1 19:48:39.339: OSPF: Send with youngest Key 2
*Mar  1 19:48:39.339: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:44.523: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2
*Mar  1 19:48:44.527: OSPF: End of hello processing
*Mar  1 19:48:49.343: OSPF: Send with youngest Key 2
*Mar  1 19:48:49.343: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0 from 1.1.1.1
*Mar  1 19:48:54.531: OSPF: Rcv hello from 1.1.1.2 area 0 from Ethernet0 1.1.1.2

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据