RIP认证
RIP的认证是一种模块化的配置,密钥链的定义和协议无关,只需要在接口上启用就可以了。RIP版本2支持明文和MD5加密口令的认证,默认的认证方式是明文口令。因此,我推荐使用RIPv2版本(RIPV1不支持认证)。具体配置步骤如下:
1.定义钥匙链
全局模式下:
RA(config)#key chain 钥匙链名称
一个密钥链可以有多个密钥号码
2.定义密钥号码
可以定义多个,取值范围是:0-2147483647。先使用号码低的,低的失效后使用号码高的。
RA(config-keychain)#key 密钥号码    
3.定义密钥的开始使用时间,再订立多个密钥的情况下,可以让不同的密钥在不同的时间实效,有效,大大增强了方便性和安全性注意,这两个密钥之间最好有30分钟的重叠时间。
RA(config-keychain-key)#accept-lifetime {start} {infinite|end|duration seconds}
RA(config-keychain-key)#send-lifetime {start} {infinite|end|duration seconds}
R1(config-keychain-key)#?
Key-chain key configuration commands:
accept-lifetime Set accept lifetime of key             #设置开始使用时间和失效时间,特别注意,accept lifetime 和 send lifetime 是单向配置的,相当于DCE、DTE的时钟
default          Set a command to its defaults
exit             Exit from key-chain key configuration mode
key-string       Set key string                         #设置密钥串
no               Negate a command or set its defaults
send-lifetime    Set send lifetime of key               #设置失效时间
例:R1(config-keychain-key)#accept-lifetime local 20:00:00 1 apr 2009 duration 60
4.定义密钥
RA(config-keychain-key)#key-string {password}             #相连的双方密码一样
5.启用RIP认证,调用配置的密钥链,在接口模式下
RA(config-if)#ip rip authentication key-chain {name }   
6.定义认证方式,RIPV2支持明文和MD5 的认证,默认是明文认证
RA(config-if)#ip rip authentication mode {text|md5}
7.show run的结果
注:对端R2的配置和R1类似
R1#sho run
Building configuration...
Current configuration : 1039 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
!
key chain test                                             #密钥链名
key 100                                                   #密钥号码
key-string 123456                                        #密钥
accept-lifetime local 20:00:00 Apr 1 2009 duration 60    #密钥的启用时间和生存时间
!
!
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.0.0.0
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0         
ip rip authentication mode md5                             #RIP认证的方式,此处为md5加密
ip rip authentication key-chain test                       #在F0/0接口下应用名为test的密钥链
duplex half
!
interface Ethernet1/0
no ip address
shutdown
duplex half
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
router rip
version 2
network 1.0.0.0
network 192.168.1.0
!
ip classless
no ip http server
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
transport preferred all
transport output all
stopbits 1
line aux 0
line vty 0 4
!
!
end
注:1.配置认证前先确保普通RIP能学习到;
       2.如果一个路由器连接两个路由器,其两个接口的密钥、密钥链等可以不一样,分别与相
            连的路由器对应;
       3.推荐使用V2版本;
       4.设置开始使用时间和失效时间,特别注意,accept lifetime 和 send lifetime 是单向配置的,相当于
          DCE、DTE的时钟。