RIP(Routing Information Protocols,路由信息协议)是应用较早、使用较普遍的IGP(Interior Gateway Protocol,内部网关协议),适用于小型同类网络,是典型的距离矢量(distance-vector)协议。RIP协议跳数做为衡量路径开销的,RIP协议里规定最大跳数为15。RIP协议有两个版本RIPv1和RIPv2。
RIPv1属于有类路由协议,不支持VLSM(变长子网掩码),RIPv1是以广播的形式进行路由信息的更新的;更新周期为30秒。
RIPv2属于无类路由协议,支持VLSM(变长子网掩码),RIPv2是以组播的形式进行路由信息的更新的,组播地址是224.0.0.9。RIPv2还支持基于端口的认证,提高网络的安全性。实现网络的互连互通,从而实现信息的共享和传递。
S3760三层交换机(1台)、RSR20路由器(两台)、V35线缆(1条)、PC(两台)、直连线或交叉线(2条)
注意事项;
1、在串口上配置时钟频率时,一定要在电缆DCE端的路由器上配置,否则链路不通。
2、No auto-summary功能只有在RIPv2支持。
3、S3550-24没有no auto-summary命令。
4
、PC主机网关一定要指向直连接口IP地址,例如PC1网关指向三层交换机VLAN50的IP地址。
试验拓扑图:
试验步骤:
1、先对PC0和PC1配置IP和网关。
PC0 1.1.1.1 255.0.0.0(子网掩码) 1.1.1.2(默认网关)
PC1 1.1.4.1 255.0.0.0(子网掩码) 1.1.4.2(默认网关)
2、在三层交换机上划分vlan10和vlan20,创建虚拟接口并设置IP,使之开启路由功能。
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport access vlan 10
Switch(config)#interface vlan 10
Switch(config-if)#ip address 1.1.1.2 255.0.0.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#ip address 1.1.2.1 255.0.0.0
Switch(config-if)#no shutdown
3、对两台路由设备配置IP地址,找出DCT串口设置时钟频率、。
假如DCT串口是ROUTER0
对ROUTER0的设置:
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 1.1.2.2 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 2/0
Router(config-if)#ip address 1.1.3.1 255.0.0.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
对ROUTER2 的设置:
Router(config)#interface serial 2/0
Router(config-if)#ip address 1.1.3.2 255.0.0.0
Router(config-if)#no shutdown
4、对三层交换机和两台路由器查看路由表(show ip route)。
交换机:
Switch#show ip rout
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 1.0.0.0/8 is directly connected, Vlan10
ROUTER0:
Router#show ip rou
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 1.0.0.0/8 is directly connected, FastEthernet0/0
ROUTER1:
Router#SHOW IP ROUte
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
5、对三层交换机和两台路由器均开启RIP或者开启OSPF进程,再次查看路由表。对比两次查看的结果。
开启OSPF进程
三层交换机的:
Switch(config)#router ospf
Switch(config-router)#network 192.168.2.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#end
对两个个路由器进行同样的设置:
Router(config)#router ospf 1
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router(config-router)#end
也可以开启RIP进程
三层交换机的:
Switch(config)#router rip
Switch(config-router)#network 192.168.1.0
Switch(config-router)#network 192.168.2.0
Switch(config-router)#version 2
对路由器进行同样的设置:
Router(config)#ROUter RIP
Router(config-router)#NETwork 192.169.3.0
Router(config-router)#NETwork 192.169.4.0
Router(config-router)#VERsion 2
Router(config-router)#END
6、测试PC0和PC1的连通性。