预配置:
R1上的预配置
Int lo0
Ip add 1.1.1.1 255.255.255.0
Int e1/0
Ip add 12.0.0.1 255.255.255.0
No sh
R2上的预配置
Int lo0
Ip add 2.2.2.2 255.255.255.0
Int e1/0
Ip add 12.0.0.2 255.255.255.0
No sh
电脑上的预配置
实验过程
第一步:在R1和R2上配置明文密码
R1(config-if)#router os 11
R1(config-router)#area 0 authentication
R1(config)#int e1/0 R1(config-if)#ip ospf authentication-key cisco *Mar 1 00:50:31.787: OSPF: Rcv pkt from 12.0.0.2, Ethernet1/0 : Mismatch Authentication type. Input packet specified type 0, we use type 1 //这里我们在R1上启用了明文认证,而R2上没有认证,这里明显显示了这样的情况
我们在R2上启用认证 **R2(config-if)#router os 11 R2(config-router)#area 0 authentication **
R2(config)#int e1/0 R2(config-if)#ip ospf authentication-key cisco *Mar 1 00:55:11.891: %OSPF-5-ADJCHG: Process 11, Nbr 2.2.2.2 on Ethernet1/0 from LOADING to FULL, Loading Done 第二步:我们将R1和R2上的明文改为密文 R1(config)#int e1/0 R1(config-if)#ip ospf authentication message-digest R1(config-if)#ip ospf message-digest-key 1 md5 cisco
R2(config)#int e1/0 R2(config-if)#ip ospf authentication message-digest R2(config-if)#ip ospf message-digest-key 1 md5 cisco
*Mar 1 01:11:03.591: %OSPF-5-ADJCHG: Process 11, Nbr 1.1.1.1 on Ethernet1/0 from LOADING to FULL, Loading Done //这里我们看到了邻居关系起来了
我们对md5 认证过程抓了一个包分析,工具为wireshark
//我们主要看看md5加密过的和未加密的区别,就在最后一行