[P1R1]
key chain cisco
key 1
key-string mypassword
int f0/0
ip rip auth key-chain cisco
ip rip auth mode md 5
int s1/1
ip rip auth key-chain cisco
ip rip auth mode md5
验证结果
在P1R1上定义密钥以后,分别在s1/1和f0/0上面启用,在其他路由器并没有启用相同的密钥的时候,通过debug ip rip eve查看:
16:18:45: RIP: ignored v2 packet from 192.168.1.2 (invalid authentication)
sh ip route查看
R 192.168.3.0/24 is possibly down, routing via 192.168.2.2, FastEthernet0/0
说明因为密钥匹配原因,packet ignored,并且路由条目状态变化为possibly down
在P1R2上定义同样密钥后
debug 信息显示
Page 5 of Cisco Tec! - Powered by Discuz! Board 31
P1R4上sh ip route,可以看到
16:31:16: RIP: received packet with MD5 authentication
认证成功
附加部分
在P1R2上采用同样密钥,但是在接口上应用的时候如果采用明文方式 ip rip auth mod text(P1R1采用MD5加密)
因为两边不匹配,则一样会invalid authentication
注意
可以在路由器上配置RIPv2消息认证包括:明文或MD5加密密码
在钥匙链(key-chain)上定义多个秘钥(key)或密码,后者可选
定义秘钥链名称:key chain test
定义秘钥 key 1
定义密码key-string cisco
在接口上启用 int e0/0 ip rip authentication key-chain test
定义发送方式 ip rip authtication mode md5
记住,钥匙链-钥匙-钥匙的凹凸代表密码,必须在个锁(接口)上使用此钥匙(引用)
sh ip pro可以查看version和keychain情况
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 2 2 cisco
Serial1/1 2 2 cisco
Loopback0 2 2