动态路由协议——RIP
记录每日所学
一、RIP路由
路由信息协议(英语:Routing Information Protocol,缩写:RIP),是一种使用最广泛的内部网关协议(IGP),属于网络层,一种在网关与主机之间交换路由选择信息的标准。
1、RIP的基本概念:
(1)、定期更新 30秒
(2)、邻居
(3)、广播更新、组播更新
(4)、全路由表更新
RIP度量值为:跳数最大跳数为15跳,16跳为不可达
RIP更新时间:每个30秒发送路由更新消息,UDP520端口
2、RIP会产生路由环路 :
(1)、解决方法水平分割可以阻止路由环路的发生
水平分割:
(1)、从一个接口学习到路由信息不会从这个接口发送出去
(2)、同时也减少链路带宽资源
3、RIPv1 VS RIPv2
区别
| RIPv1 | RIPv2 |
|---|---|
| 有类路由协议 | 无类路由协议 |
| 广播更新(255.255.255.255) | 组播更新(224.0.0.9) |
| 不支持VLSM、子网掩码默认 | 支持VLSM、子网掩码可以不保持默认 |
| 自动路由汇总,不可关闭 | 自动汇总可关闭,可手动汇总 |
| 不支持不联系子网 | 支持不连续子网 |
4、什么是主类网络边界?
指的是两个不同的主类网络之间的路由网段
RIPv1:跨越主类边界就会自动汇总,不跨越主类边界则不会
实验:

R1的配置:
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
uawei]sysname R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0 0
[R1-ui-console0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R1-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]qu
[R1]rip
[R1-rip-1]network 10.0.0.0
[R1-rip-1]qu
R2配置:
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[R2-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 24
[R2-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]qu
[R2]rip
[R2-rip-1]network 10.0.0.0
[R2-rip-1]network 172.16.0.0
[R2-rip-1]qu
R3配置:
[R3-ui-console0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 172.16.1.2 24
[R3-GigabitEthernet0/0/1]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R3-GigabitEthernet0/0/0]qu
[R3]rip
[R3-rip-1]network 172.16.0.0
[R3-rip-1]network 12.0.0.0
[R3-rip-1]qu
R4配置:
[R4-ui-console0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[R4-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R4-GigabitEthernet0/0/0]qu
[R4]rip
[R4-rip-1]network 12.0.0.0
[R4-rip-1]qu
查看路由表:

不跨主类边界的效果:

查看路由表:

