R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#interface fastethernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R2(config)#interface loopback 0
R2(config-if)#ip address 1.1.2.1 255.255.255.0
R2(config-if)#interface fastethernet 0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R3(config)#interface fastethernet 0/0
R3(config-if)#ip address 192.168.1.3 255.255.255.0
R3(config-if)#interface serial2/2
R3(config-if)#ip address 10.1.1.1 255.255.255.252
R3(config-if)#no shutdown
R4(config)#interface loopback 0
R4(config-if)#ip address 172.16.1.1 255.255.255.0
R4(config-if)#interface loopback 1
R4(config-if)#ip address 172.16.2.1 255.255.255.0
R4(config-if)#interface loopback 2
R4(config-if)#ip address 172.16.3.1 255.255.255.0
R4(config-if)#interface serial 2/1
R4(config-if)#ip address 10.1.1.2 255.255.255.0
R4(config-if)#no shutdown
R1(config-router)#version 2 //修改RIP的版本为2
R1(config-router)#no auto-summary //关闭自动汇总
R1(config-router)#network 1.0.0.0 //宣告网段
R1(config-router)#network 192.168.1.0
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.1.0
R3(config-router)#network 10.0.0.0
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 172.16.0.0
R4(config-router)#network 10.0.0.0
R3(config-router)#passive-interface fastethernet 0/0
R3(config-router)#neighbor 192.168.1.1
R3(config-keychain)#key 1 //配置KEY ID
R3(config-keychain-key)#key-string 123 //配置KEY ID的密码
R3(config-keychain-key)#exit
R3(config-keychain)#exit
R4(config-keychain)#key 1
R4(config-keychain-key)#key-string 123
R4(config-keychain-key)#exit
R4(config-keychain)#exit
R3(config-if)#ip rip authentication mode md5 //配置RIP认证为密文认证(默认为明文)
R3(config-if)#ip rip authentication key-chain ccna //配置RIP认证使用key-chain ccna
R4(config-if)#ip rip authentication mode md5
R4(config-if)#ip rip authentication key-chain ccna
R4(config-if)#ip summary-address rip 172.16.0.0 255.255.252.0 //手动汇总
R4(config-if)#no ip split-horizon //关闭水平分割
R4(config-if)#end
R4#debug ip rip
RIP protocol debugging is