Cisco配置RIP路由

动态路由分类

RIP简介

  • RIP是应用及开发较早的路由协议,是典型的距离矢量路由协议
  • 适用于小型网络,最大跳数15跳(16跳视为不可达)
  • RIP是基于UDP的,使用端口号520
  • 在CISCO IOS平台上的管理性距离为120

RIP各个版本的区别

实验拓扑

初始配置

配置R1各个接口IP

sh 复制代码
Router>enable 
Router#configure terminal 
Router(config)#hostname R1

R1(config)#interface e0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown 

R1(config-if)#interface e0/1
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown 

配置R2各个接口IP

sh 复制代码
Router>enable 
Router#configure terminal 
Router(config)#hostname R2
R2(config)#

R2(config)#interface e0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown 

R2(config-if)#interface e0/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown 

配置R3各个接口IP

sh 复制代码
Router>enable 
Router#configure terminal 
Router(config)#hostname R3
R3(config)#

R3(config)#interface e0/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown 

R3(config-if)#interface e0/1
R3(config-if)#ip address 192.168.3.254 255.255.255.0
R3(config-if)#no shutdown

配置Vpc4和vpc5的ip

sh 复制代码
VPCS> ip 192.168.1.2/24 192.168.1.254
Checking for duplicate address...
VPCS : 192.168.1.2 255.255.255.0 gateway 192.168.1.254
sh 复制代码
VPCS> ip 192.168.3.2/24 192.168.3.254
Checking for duplicate address...
VPCS : 192.168.3.2 255.255.255.0 gateway 192.168.3.254

配置RIP

在R1上配置RIP并宣告网络

sh 复制代码
# 启动RIP进程
R1(config)#router rip 

# 选择版本2
R1(config-router)#version 2

# 宣告指定指定的直连网络(接口)
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.12.0

在R2上配置RIP并宣告网络

sh 复制代码
R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.23.0

在R3上配置RIP并宣告网络

sh 复制代码
R3(config)#router rip

R3(config-router)#version 2

R3(config-router)#network 192.168.23.0
R3(config-router)#network 192.168.3.0

查看路由

在R1上查看路由

sh 复制代码
R1#show ip route 
Codes: L - local, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Ethernet0/1
L        192.168.1.254/32 is directly connected, Ethernet0/1
R     192.168.3.0/24 [120/2] via 192.168.12.2, 00:00:13, Ethernet0/0
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.1/32 is directly connected, Ethernet0/0
R     192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:13, Ethernet0/0

可以看到R1学习到了192.168.3.0/24和192.168.23.0/24网段的路由

在R2上查看路由

sh 复制代码
R2# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

R     192.168.1.0/24 [120/1] via 192.168.12.1, 00:00:08, Ethernet0/0
R     192.168.3.0/24 [120/1] via 192.168.23.3, 00:00:17, Ethernet0/1
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.2/32 is directly connected, Ethernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/1
L        192.168.23.2/32 is directly connected, Ethernet0/1

可以看到R2学习到了192.168.1.0/24和192.168.3.0/24网段的路由

在R3上查看路由

sh 复制代码
R3#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

R     192.168.1.0/24 [120/2] via 192.168.23.2, 00:00:03, Ethernet0/0
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, Ethernet0/1
L        192.168.3.254/32 is directly connected, Ethernet0/1
R     192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:03, Ethernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/0
L        192.168.23.3/32 is directly connected, Ethernet0/0

可以看到R3学习到了192.168.1.0/24和192.168.12.0/24网段的路由

ping测试

在vpc4上ping vpc5

sh 复制代码
VPCS> ping 192.168.3.2

84 bytes from 192.168.3.2 icmp_seq=1 ttl=61 time=1.202 ms
84 bytes from 192.168.3.2 icmp_seq=2 ttl=61 time=0.751 ms
84 bytes from 192.168.3.2 icmp_seq=3 ttl=61 time=0.916 ms
84 bytes from 192.168.3.2 icmp_seq=4 ttl=61 time=0.743 ms
84 bytes from 192.168.3.2 icmp_seq=5 ttl=61 time=0.834 ms
相关推荐
qq 17780362232 分钟前
智能新时代,游戏盾守护顺畅体验
运维·服务器·网络·游戏·云计算·ddos·ip
神秘的土鸡2 小时前
Linux中使用Docker容器构建Tomcat容器完整教程
linux·运维·服务器·docker·容器·tomcat
TravisBytes2 小时前
linux 系统是如何收发数据包
linux·运维·服务器
德迅--文琪4 小时前
SCDN是服务器吗?SCDN防御服务器有什么特点?
运维·服务器
ice___Cpu4 小时前
Linux 基本使用和 web 程序部署 ( 8000 字 Linux 入门 )
linux·运维·前端
z202305084 小时前
linux 之0号进程、1号进程、2号进程
linux·运维·服务器
Hqst_Kevin5 小时前
Hqst 品牌 H81801D 千兆 DIP 网络变压器在光猫收发器机顶盒中的应用
运维·服务器·网络·5g·网络安全·信息与通信·信号处理
honey ball6 小时前
仪表放大器AD620
运维·单片机·嵌入式硬件·物联网·学习
秋已杰爱6 小时前
进程间关系与进程守护
运维·服务器
Flying_Fish_roe6 小时前
linux-软件包管理-包管理工具(Debian 系)
linux·运维·debian