第一步:R1上的预配置(这里使用V2版本)R1(config)#R1(config)#int s1/2R1(config-if)#ip add 192.168.0.1 255.255.255.0R1(
.
第一步:R1上的预配置(这里使用V2版本)
R1(config)#
R1(config)#int s1/2
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo0
R1(config-if)#ip add 172.16.0.1 255.255.255.0
R1(config-if)#
R1(config-if)#^Z
R1#
第二步:R2上的预配置(这里使用v2版本)
R2(config)#int s2/1
2(config-if)#no ip address 192.168.0.1 255.255.255.0
R2(config-if)#ip add 192.168.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo0
R2(config-if)#ip add 172.16.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#
实验过程:
第一步:在R1上配置密码
R1(config)#key chain R1 (配置钥匙链)
R1(config-keychain)#key 1 (配置KEY ID)
R1(config-keychain-key)#key-string cisco (配置 KEY ID 的密匙)
R1(config-keychain-key)#exit
R1(config-keychain)#exit
R1(config)#int s1/2
R1(config-if)#ip rip authentication mode md5
R1(config-if)#ip rip authentication key-chain R1
R1(config-if)#exit
R1(config)#
第二步:现在在R1使用debug ip rip进行调试
R1#debug ip rip
RIP protocol debugging is on
00:19:20: RIP: ignored v2 packet from 192.168.0.2 (invalid authentication)
(这里没有通过认证)
R1#sh ip pro
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 16 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Key-chain
Serial1/2 2 2 R1 (这里使用了R1)
Loopback0 2 2
Routing for Networks:
172.16.0.0
192.168.0.0
Routing Information Sources:
Gateway Distance Last Update
192.168.0.2 120 00:03:36
Distance: (default is 120)
第三步:在R2进行配置
R2(config)#key ch
R2(config)#key chain R2
R2(config-keychain)#key 3
R2(config-keychain-key)#key
R2(config-keychain-key)#key-string cisco
R2(config-keychain-key)#exit
R2(config-keychain)#int s2/1
R2(config-if)#ip rip authentication mod md5
R2(config-if)#ip rip authentication key-chain R2
R2(config-if)#
第四步:在R2进行调试
R2#debug ip rip
R2#clear ip route *
R2#
00:25:21: RIP: sending general request on Serial2/1 to 224.0.0.9
00:25:21: RIP: sending general request on Loopback0 to 224.0.0.9
00:25:21: RIP: ignored v2 packet from 172.16.1.2 (sourced from one of our addresses)
R2#
00:25:24: RIP: sending v2 update to 224.0.0.9 via Serial2/1 (192.168.0.2)
00:25:24: 172.16.0.0/16 -> 0.0.0.0, metric 1, tag 0
00:25:24: RIP: sending v2 update to 224.0.0.9 via Loopback0 (172.16.1.2)
00:25:24: 192.168.0.0/24 -> 0.0.0.0, metric 1, tag 0
00:25:24: RIP: ignored v2 packet from 172.16.1.2 (sourced from one of our addresses)
R2#
00:25:34: RIP: received packet with MD5 authentication (通过认证)
00:25:34: RIP: received v2 update from 192.168.0.1 on Serial2/1
00:25:34: 172.16.0.0/16 -> 0.0.0.0 in 1 hops
00:25:34: RIP: sending v2 update to 224.0.0.9 via Serial2/1 (192.168.0.2)
00:25:34: 172.16.0.0/16 -> 0.0.0.0, metric 1, tag 0
00:25:34: RIP: sending v2 update to 224.0.0.9 via Loopback0 (172.16.1.2)
00:25:34: 172.16.0.0/16 -> 0.0.0.0, metric 2, tag 0
00:25:34: 192.168.0.0/24 -> 0.0.0.0, metric 1, tag 0
00:25:34: RIP: ignored v2 packet from 172.16.1.2 (sourced from one of our addresses)
R2#