1.路由协议基础

共同的目的:更新、维护和控制3层的路由

工作机制:

RIP,封装在UDP这个协议上,端口号520(优先级100)

OSPF,封装在IP层,协议号89(优先级,内部10,外部是150-ASE)

中间系统到中间系统,OSI模型上的路由协议,直接封装在2层上,直接把协议报文发到0014(L1)/0015(Level2)上,优先级15

BGP,封装在TCP这协议上的,端口号179(优先级255)

RIP到底工作在3层还是4层?

优先级本地有效(不能影响其他路由器的协议竞争路由表)

2.RIP 基础配置

报文:request、response(command)

基本的配置:

[R2]dis current-configuration configuration rip

[V200R003C00]

#

rip 1

network 10.0.0.0

network 22.0.0.0

[R2]dis rip 1 neighbor

IP Address Interface Type Last-Heard-Time

10.1.12.1 Serial2/0/0 RIP 0:0:10

Number of RIP routes : 2

RIP每个30s来发送一次response

[R2]dis ip rou pro rip

Route Flags: R - relay, D - download to fib

Public routing table : RIP

Destinations : 3 Routes : 3

RIP routing table status : <Active>

Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost(HOP) Flags NextHop Interface

    1.0.0.0/8   RIP     100  1           D   10.1.12.1       Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0
11.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0

<R2>dis rip 1 route

Route Flags : R - RIP

A - Aging, G - Garbage-collect

Peer 10.1.12.1 on Serial2/0/0

Destination/Mask Nexthop Cost Tag Flags Sec

11.1.1.1/32 10.1.12.1 1 0 RA 180

10.1.1.0/24 10.1.12.1 1 0 RA 180

1.1.1.1/32 10.1.12.1 1 0 RA 180 //老话时间aging time到时,会切换到垃圾收集时间,此时路由消失,但是DB中依旧存在:<R2>dis ip rou pro rip

<R2>

<R2>dis rip 1 route

Route Flags : R - RIP

A - Aging, G - Garbage-collect

Peer 10.1.12.1 on Serial2/0/0

Destination/Mask Nexthop Cost Tag Flags Sec

11.1.1.1/32 10.1.12.1 16 0 RG 84

10.1.1.0/24 10.1.12.1 16 0 RG 84

1.1.1.1/32 10.1.12.1 16 0 RG 84 //进入120s的垃圾收集时间,意味着该表项中存在于RIP路由表,而全局路由表早已消失

[R2-rip-1]timers rip 29 179 119 //修改RIP的时间值

3.防环机制:

1)水平分割(split horizon),从某个接口收到了路由。就不会再把该路由从接口发出去(被动方式)

<R2>dis rip 1 int ver

Serial2/0/0(10.1.12.2)

State : UP MTU : 500

Metricin : 0 

Metricout : 1 

Input : Enabled Output : Enabled 

Protocol : RIPv2 Multicast

Send version : RIPv2 Multicast Packets 

Receive version : RIPv2 Multicast and Broadcast Packets

Poison-reverse : Disabled 

Split-Horizon : Enabled //水平分割开启

Authentication type : None 

Replay Protection : Disabled

2)毒性逆转,发送不可达路由告知邻居路由器(主动方式,坏消息总比没有消息强)

interface Serial2/0/0

link-protocol ppp

ip address 10.1.12.2 255.255.255.0 

rip poison-reverse //开启毒性逆转

3)触发更新

拍错:

rip metricin 15 //入方向度量值15

[R2]display rip 1 database //验证数据库

Advertisement State : [A] - Advertised

[I] - Not Advertised/Withdraw 代表消失

1.0.0.0/8, cost 16, ClassfulSumm

1.1.1.1/32, cost 16, [I], nexthop 10.1.12.1

10.0.0.0/8, cost 0, ClassfulSumm

10.1.1.0/24, cost 16, [I], nexthop 10.1.12.1

10.1.12.0/24, cost 0, [A], Rip-interface

11.0.0.0/8, cost 16, ClassfulSumm

11.1.1.1/32, cost 16, [I], nexthop 10.1.12.1

[R1-Serial2/0/0]rip metricout 9 

interface Serial2/0/0

link-protocol ppp

ip address 10.1.12.1 255.255.255.0 

rip metricout 2000 8 //精准的对acl 2000匹配的路由来进行度量值的修改

[R1]dis acl all

Total quantity of nonempty ACL number is 1

4.静默端口(RIP、OSPF、中间系统到中间系统都存在)

不在发送某种协议的报文,通常用在环回接口以及连接终端的接口上,用于构建邻居的物理接口上。

rip 1

version 2

network 10.0.0.0

network 22.0.0.0

silent-interface all //静默所有接口

silent-interface disable Serial2/0/0//排除物理接口,物理接口不要静默,用于构建邻居

Basic ACL 2000, 1 rule

Acl's step is 5

rule 10 permit source 1.1.1.1 0 (3 matches)

5.汇总:在路由可用的前提下减少路由条目数

RIP可以在任何一个设备做汇总,要在路由更新出去的接口来实施

11.1.1.1 0000,0001

11.1.1.2 0000.0010

11.1.1.3 0000,0011

11.1.1.0 255.255.255.252

[R1-Serial2/0/0]rip summary-address 11.1.1.0 255.255.255.252 //推荐使用手工汇总

[R2-rip-1]dis ip rou pro rip

Route Flags: R - relay, D - download to fib

Public routing table : RIP

Destinations : 3 Routes : 3

RIP routing table status : <Active>

Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

    1.1.1.1/32  RIP     100  8           D   10.1.12.1       Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0
11.1.1.0/30 RIP 100 1 D 10.1.12.1 Serial2/0/0

不推荐的自动汇总,把路由汇总到主类的边界

[R2-rip-1]summary always 

[R2-rip-1]dis ip rou pro rip

Route Flags: R - relay, D - download to fib

Public routing table : RIP

Destinations : 3 Routes : 3

RIP routing table status : <Active>

Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

    1.0.0.0/8   RIP     100  1           D   10.1.12.1       Serial2/0/0
10.1.1.0/24 RIP 100 1 D 10.1.12.1 Serial2/0/0 //为什么这条路由没有自动汇总呢?
11.0.0.0/8 RIP 100 1 D 10.1.12.1 Serial2/0/0

RIP routing table status : <Inactive>

Destinations : 0 Routes : 0

如果需要汇总的网络和RIP构建邻居的接口同一个主类网络,则不会汇总

需求:

1.两个设备各自通告自身的环回接口,建立邻居之后手工汇总环回接口到/16

2.静默所有接口,请使用单播来建立邻居关系,使用单播来更新RIP报文

3.R1增加一个额外的环回接口1.1.1.1,R2上得到这一条路由的度量为15

本文转自EnderJoe 51CTO博客,原文链接:http://blog.51cto.com/enderjoe/2057525

最新文章

  1. [BZOJ4199][NOI2015]品酒大会
  2. Java读写文本文件操作
  3. php+mysql+smarty+oop
  4. ESXi 5.5开启并配置SNMP
  5. Android Intent
  6. Linux----LVM扩容磁盘空间
  7. www.97top10.com--做最好的技术交流网站
  8. gridview header增加排序图标
  9. QQ登入(3)QQ空间分享-无需登入
  10. 初次体验架设PHP网站
  11. LR之配置端口映射(port mapping)
  12. SQL SERVER 中如何将NULL转换为0
  13. android studio sexy editor性感编辑器设置
  14. 【搬运工】之——Selenium+IDEA+Maven+TestNG环境搭建(转)
  15. PA 项目关联项目经理
  16. JavaScript数据类型 正则表达式RegExp类型
  17. BZOJ 1977 严格次小生成树(算竞进阶习题)
  18. 用R创建Word和PowerPoint文档--转载
  19. 比较不错的几款开源的WPF Charts报表控件
  20. SQL之mysql常用操作语句(入门级)

热门文章

  1. CF633(div.2)A. Filling Diamonds
  2. php--phpstorm使用正则匹配批量替换
  3. 28.3 api--date 日期 (日期获取、格式化)
  4. 来说说Java中String 类的那些事情
  5. [模板]SPFA判负环
  6. 简单了解下CAP定理与BASE定理
  7. # Unity 游戏框架搭建 2019 (三十四、三十五) 9 ~ 10 示例整理
  8. 数值计算方法实验之Lagrange 多项式插值 (Python 代码)
  9. 用scanf、printf输入输出string型字符串
  10. Linux源码安装步骤