rip配置(上):
实验目的:
(1)简单rip配置
(2)rip v1与rip v2兼容问题
(1)简单rip配置:
r1配置:
基本信息配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r1
接口信息配置:
r1(config)#in s1/0
r1(config-if)#ip add 219.146.0.1 255.255.255.0
r1(config-if)#no shut
r1(config-if)#in s1/1
r1(config-if)#ip add 219.146.2.1 255.255.255.0
r1(config-if)#no shut
r1(config-if)#exi
rip v2配置:
r1(config)#router rip
r1(config-router)#version 2 //rip版本2
r1(config-router)#no auto-summary //不自动汇总
r1(config-router)#network 219.146.0.0 //添加直连网络
r1(config-router)#network 219.146.2.0
r1(config-router)#exi
r2配置:
基本信息配置
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r2
接口信息配置:
r2(config)#in s1/0
r2(config-if)#ip add 219.146.0.2 255.255.255.0
r2(config-if)#no shut
r2(config-if)#in s1/2
r2(config-if)#ip add 219.146.1.1 255.255.255.0
r2(config-if)#no shut
r2(config-if)#exi
rip v2配置:
r2(config)#router rip
r2(config-router)#version 2
r2(config-router)#no auto-summary
r2(config-router)#network 219.146.0.0
r2(config-router)#network 219.146.1.0
r2(config-router)#exi
r3配置:
基本信息配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r3
接口信息配置:
r3(config)#in s1/2
r3(config-if)#ip add 219.146.1.2 255.255.255.0
r3(config-if)#no shut
r3(config-if)#in s1/1
r3(config-if)#ip add 219.146.2.2 255.255.255.0
r3(config-if)#no shut
r3(config-if)#exi
rip v2配置:
r3(config)#router rip
r3(config-router)#version 2
r3(config-router)#no auto-summary
r3(config-router)#network 219.146.1.0
r3(config-router)#network 219.146.2.0
r3(config-router)#exi
rip v2的一般配置就完成了,已经可以正常路由了,很简单吧!
(2)rip v1与rip v2兼容问题
r2(config)#router rip
r2(config-router)#no version 2 //让r2的rip版本为v1版
r2(config-router)#exi
结果如下:
r1(config)#do show ip route //查看路由表
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.0.0/24 is directly connected, Serial1/0
R 219.146.1.0/24 [120/1] via 219.146.2.2, 00:00:21, Serial1/1
[120/1] via 219.146.0.2, 00:00:19, Serial1/0
发现一切正常,没变化。
r1(config)#end
r1#clear ip route * //重新学习一下路由表
r1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.0.0/24 is directly connected, Serial1/0
R 219.146.1.0/24 [120/1] via 219.146.2.2, 00:00:09, Serial1/1
问题出来了,到219.146.1.0只有一条路由了。
同样,在r3上也查看如下:
r3(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
R 219.146.0.0/24 [120/1] via 219.146.2.1, 00:00:18, Serial1/1
[120/1] via 219.146.1.1, 00:00:44, Serial1/2
C 219.146.1.0/24 is directly connected, Serial1/2
r3(config)#end
r3#clear ip route * //重新学习路由表
r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
R 219.146.0.0/24 [120/1] via 219.146.2.1, 00:00:07, Serial1/1
C 219.146.1.0/24 is directly connected, Serial1/2
问题同上,但此时r2的路由表却没有改变,因此,得出结论:
v1能学到v2的路由表,但v2不能学到v1的。
有两种解决方法:
一、在rip v1上操作:
r2(config)#in s1/0 //进接口
r2(config-if)#ip rip send version 2 //发送v2版的更新包
r2(config-if)#exi
结果如下:
r1#clear ip route *
r1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.0.0/24 is directly connected, Serial1/0
R 219.146.1.0/24 [120/1] via 219.146.2.2, 00:00:07, Serial1/1
[120/1] via 219.146.0.2, 00:00:03, Serial1/0
发现已经正常了,说明已经解决问题。
二、在rip v2上操作:
r3#conf t
r3(config)#in s1/2 //进接口
r3(config-if)#ip rip receive version 1 //接收v1版的更新包
r3(config-if)#exi
r3(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 219.146.2.0/24 is directly connected, Serial1/1
R 219.146.0.0/24 [120/1] via 219.146.2.1, 00:00:24, Serial1/1
[120/1] via 219.146.1.1, 00:00:15, Serial1/2
C 219.146.1.0/24 is directly connected, Serial1/2
发现也已经正常,说明办法可行。
实验完成。