2.1.1实验目的:
在路由器R2上配置RIPv1,在R6和R3上配置RIPv2,要求R6、R3能接收到路由器R2的路由信息。
2.1.2实验拓扑:
2.1.3实验配置:
R2的配置:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Serial0/2
ip address 26.26.26.2 255.255.255.0
router rip
network 2.0.0.0
network 26.0.0.0
R6
的配置:
interface Loopback0
ip address 6.6.6.6 255.255.255.0
interface Serial0/2
ip address 26.26.26.6 255.255.255.0
interface Serial0/3
ip address 36.36.36.6 255.255.255.0
router rip
version 2
network 6.0.0.0
network 26.0.0.0
network 36.0.0.0
R3
的配置:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Serial0/3
ip address 36.36.36.3 255.255.255.0
router rip
version 2
network 3.0.0.0
network 36.0.0.0
2.1.4实验验证:
配置完成后,测试一下
可以看到:
R2可以
ping通r6 r3任何一个接口 查看路由表:
R2#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
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Loopback0
R
3.0.0.0/8 [120/2] via 26.26.26.6, 00:00:11, Serial0/2
R
36.0.0.0/8 [120/1] via 26.26.26.6, 00:00:11, Serial0/2
R
6.0.0.0/8 [120/1] via 26.26.26.6, 00:00:11, Serial0/2
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
,在
r6 r3上都ping不通2.2.2.2 这个接口!查看路由表都没有学到路由:
R6#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
R
3.0.0.0/8 [120/1] via 36.36.36.3, 00:00:14, Serial0/3
36.0.0.0/24 is subnetted, 1 subnets
C
36.36.36.0 is directly connected, Serial0/3
6.0.0.0/24 is subnetted, 1 subnets
C
6.6.6.0 is directly connected, Loopback0
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
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
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Loopback0
36.0.0.0/24 is subnetted, 1 subnets
C
36.36.36.0 is directly connected, Serial0/3
R
6.0.0.0/8 [120/1] via 36.36.36.6, 00:00:09, Serial0/3
R
26.0.0.0/8 [120/1] via 36.36.36.6, 00:00:09, Serial0/3
解决
version2
接受
version1
的方法:
R6(config)#int s0/2
R6(config-if)#ip rip receive version 1 2
R2(config)#int s0/2
R2(config-if)#ip rip send version 1 2
验证:
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
R
2.0.0.0/8 [120/2] via 36.36.36.6, 00:00:08, Serial0/3
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Loopback0
36.0.0.0/24 is subnetted, 1 subnets
C
36.36.36.0 is directly connected, Serial0/3
R
6.0.0.0/8 [120/1] via 36.36.36.6, 00:00:08, Serial0/3
R
26.0.0.0/8 [120/1] via 36.36.36.6, 00:00:08, Serial0/3
2.2RIPV2的手工汇总
2.2.1实验目的:
RIPv2是无类协议,支持可变字长掩码(VLSM) ,而 RIPv1是有类协议,只支持固定
长度的子网掩码。因此在 RIPv2中可以执行手工汇总,而 RIPv1不能。此外 RIPv2默认开
启自动汇总。
2.2.2 实验拓扑:
2.2.3实验配置:
R2
interface Loopback1
ip address 192.168.1.33 255.255.255.224
interface Loopback2
ip address 192.168.1.66 255.255.255.224
interface Loopback3
ip address 192.168.1.99 255.255.255.224
interface Serial0/2
ip address 26.26.26.2 255.255.255.0
router rip
version 2
network 26.0.0.0
network 192.168.1.0
no auto-summary
R6
interface Loopback0
ip address 6.6.6.6 255.255.255.0
interface Serial0/2
ip address 26.26.26.6 255.255.255.0
router rip
version 2
network 6.0.0.0
network 26.0.0.0
no auto-summary
2.2.4实验验证:
没配置汇总前R6学从R2学到的路由:
R6#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
6.0.0.0/24 is subnetted, 1 subnets
C
6.6.6.0 is directly connected, Loopback0
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
192.168.1.0/27 is subnetted, 3 subnets
R
192.168.1.96 [120/1] via 26.26.26.2, 00:00:07, Serial0/2
R
192.168.1.64 [120/1] via 26.26.26.2, 00:00:07, Serial0/2
R
192.168.1.32 [120/1] via 26.26.26.2, 00:00:07, Serial0/2
2.2.5汇总配置:
R2(config)#int s0/2
R2(config-if)#ip summary-address rip 192.168.1.0 255.255.255.0
2.2.6配置后R6的路由表:
R6#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
6.0.0.0/24 is subnetted, 1 subnets
C
6.6.6.0 is directly connected, Loopback0
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
R
192.168.1.0/24 [120/1] via 26.26.26.2, 00:00:06, Serial0/2
2.3RIP网络中注入默认路由
2.3.1:实验目的:
使用 ip default-network向 RIP 网络中注入默认路由
2.3.2 实验拓扑:
2.3.3 实验配置:
R6
ip route 3.3.3.0 255.255.255.0 Serial0/3
ip default-network 3.0.0.0
router rip
version 2
network 6.0.0.0
network 26.0.0.0
no auto-summary
R2
router rip
version 2
network 2.0.0.0
network 26.0.0.0
no auto-summary
R3
ip route 2.2.2.0 255.255.255.0 Serial0/3
2.3.4
试验验证
:
R6#sh 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
2.0.0.0/24 is subnetted, 1 subnets
R
2.2.2.0 [120/1] via 26.26.26.2, 00:00:00, Serial0/2
* 3.0.0.0/24 is subnetted, 1 subnets
S
3.3.3.0 is directly connected, Serial0/3
36.0.0.0/24 is subnetted, 1 subnets
C
36.36.36.0 is directly connected, Serial0/3
6.0.0.0/24 is subnetted, 1 subnets
C
6.6.6.0 is directly connected, Loopback0
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
R2#sh 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 26.26.26.6 to network 0.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Loopback0
26.0.0.0/24 is subnetted, 1 subnets
C
26.26.26.0 is directly connected, Serial0/2
R*
0.0.0.0/0 [120/1] via 26.26.26.6, 00:00:01, Serial0/2
R2#
2.4 RIPV2认证
2.4.1
实验目的:
RIPv2支持 MD5认证
2.4.2
实验拓扑:
2.4.3
实验配置:
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/2
ip address 26.26.26.2 255.255.255.0
ip rip authentication mode md5
ip rip authentication key-chain ccna
key chain ccna
key 1
key-string china
router rip
version 2
network 2.0.0.0
network 26.0.0.0
no auto-summary
当R2配置完后,在查看路由表时,发现路由表中没有了6.6.6.0网段的路由,这是因为R6还没做配置,两边不一致
R6
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Serial0/2
ip address 26.26.26.2 255.255.255.0
ip rip authentication mode md5
ip rip authentication key-chain ccna
key chain ccna
key 1
key-string china
router rip
version 2
network 2.0.0.0
network 26.0.0.0
no auto-summary
2.4.4
实验验证:
R2#ping 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/55/72 ms