当前位置 : 主页 > 编程语言 > c语言 >

华为ensp实验——RIP

来源:互联网 收集:自由互联 发布时间:2023-08-28
动态协议(RIP) 简介:(路由信息协议) 特点: 1,rip计算路由得特点:一条路由能够传递给15跳设备,16跳不可达。 2,rip协议分为两个版本,版本之间无法兼容 3,rip通过跳数计算开

动态协议(RIP)

简介:(路由信息协议)

特点:

1,rip计算路由得特点:一条路由能够传递给15跳设备,16跳不可达。

2,rip协议分为两个版本,版本之间无法兼容

3,rip通过跳数计算开销值

4,启用rip协议的路由开启的三个计时器:

(1)更新计时器:30S,启用rip协议的设备每隔30S进行更新一次路由

(2)无效计时器:180S,当经过180S后还未收到更新报文时,会将路由标机为16跳

(3)收集计时器:120S,当经过120S后16跳设备还未收到更新时,直接删除路由表

5,版本不同点:

(1)RIPV1 ------ 路由更新时,不会携带掩码信息,只能根据A,B,C类地址默认进行区分,路由采用广播方式进行更新

(2)RIPV2 ------ 路由更新时携带掩码信息,采用组播方式进行路由更新224.0.0.9,路由重分布,路由认证

1,拓扑图

华为ensp实验——RIP_组播

PC1和PC2

华为ensp实验——RIP_Ethernet_02

AR1:

<Huawei>system-view 
[Huawei]sysname AR1
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 172.47.1.254 24
[AR1-GigabitEthernet0/0/0]q
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 12.47.1.1 24
[AR1-GigabitEthernet0/0/1]q
[AR1]
[AR1]rip
# 主类网段宣告
# A类:0-127 --8
# B类:128-191 --16
# C类:192-223 --32
[AR1-rip-1]network 12.0.0.0
[AR1-rip-1]network 172.47.0.0
# 修改版本为V2
[AR1-rip-1]verify-source
[AR1-rip-1]version 2

AR2:

<Huawei>system-view 
[Huawei]sysname AR2
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 172.47.2.254 24
[AR2-GigabitEthernet0/0/1]q
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.47.1.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]
[AR2]rip
[AR2-rip-1]network 12.0.0.0
[AR2-rip-1]network 172.47.0.0
[AR2-rip-1]verify-source
[AR2-rip-1]version 2

访问测试:PC1与PC2测试通信

华为ensp实验——RIP_链路_03

2,拓扑图

华为ensp实验——RIP_链路_04

AR1

[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 13.47.1.1 24
[AR1-GigabitEthernet0/0/1]q
[AR1]interface Serial 2/0/0
[AR1-Serial2/0/0]ip address 12.47.1.1 24
[AR1-Serial2/0/0]q
[AR1]rip
[AR1-rip-1]network 12.0.0.0
[AR1-rip-1]network 172.47.0.0
[AR1-rip-1]network 13.0.0.0
# 修改开销
[AR1]interface s2/0/0
[AR1-Serial2/0/0]rip metricout 10

AR3

<Huawei>system-view 
[Huawei]sysname AR3
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.47.1.3 24
[AR3-GigabitEthernet0/0/0]q
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip address 23.47.1.3 24
[AR3-GigabitEthernet0/0/1]q
[AR3]
[AR3]rip
[AR3-rip-1]network 13.0.0.0
[AR3-rip-1]network 23.0.0.0
[AR3-rip-1]verify-source
[AR3-rip-1]version 2

AR2

[AR2]interface Serial 1/0/0
[AR2-Serial1/0/0]ip address 12.47.1.2 24
[AR2-Serial1/0/0]q
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 23.47.1.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]rip
[AR2-rip-1]network 23.0.0.0
[AR2-GigabitEthernet0/0/0]q
[AR2]interface s1/0/0
[AR2-Serial1/0/0]rip metricout 10

修改开销之前与之后对比:

华为ensp实验——RIP_组播_05

IS-IS协议

中间系统到中间系统

1,动态链路状态协议,在于链路上传递链路状态单元

2,路由更新方式:触发式组播更新方式,组播MAC地址:

0180-C200-0014(LEVEL),0180-C200-0015(LEVEL-2)

3,ISIS协议优先级默认为15,开销值:每条链路开销默认为10

4,ISIS路由器的等级分类:

(1)level-1的路由器,只能根据相同区域的level-1与level-1-2设备简历邻居关系

(2)level-1-2的路由器。只能根据相同区域的level-1与不相同区域的level-2建立邻居关系

(3)level-2的路由器,只能根据相同区域的level-1与不同区域的level-2建立邻居关系

拓扑图

华为ensp实验——RIP_组播_06

实验实施

AR1
<Huawei>system-view 
[Huawei]sysname AR1
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.47.1.1 24
[AR1-GigabitEthernet0/0/0]q
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 13.47.1.1 24
[AR1-GigabitEthernet0/0/1]q
[AR1]interface LoopBack 0
[AR1-LoopBack0]ip address 172.47.1.1 24
[AR1-LoopBack0]ip address 172.47.2.1 24 sub 
[AR1-LoopBack0]q
[AR1]isis
[AR1-isis-1]network-entity 49.0001.0000.0000.0001.00
[AR1-isis-1]is-level level-2
[AR1-isis-1]q
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]isis enable 
[AR1-GigabitEthernet0/0/0]q
[AR1]interface GigabitEthernet 0/0/1    
[AR1-GigabitEthernet0/0/1]isis enable 
[AR1-GigabitEthernet0/0/1]q
[AR1]interface LoopBack 0
[AR1-LoopBack0]isis enable 
[AR1-LoopBack0]q
AR2
<Huawei>system-view 
[Huawei]sysname AR2
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.47.1.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.47.1.1 24
[AR2-GigabitEthernet0/0/1]q
[AR2]isis 
[AR2-isis-1]network-entity 49.0002.0000.0000.0002.00
[AR2-isis-1]q
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]isis enable 
[AR2-GigabitEthernet0/0/0]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]isis enable 
[AR2-GigabitEthernet0/0/1]q
[AR2]
AR3
<Huawei>system-view 
[Huawei]sysname AR3
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.47.1.2 24
[AR3-GigabitEthernet0/0/0]q
[AR3]
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip ad 
[AR3-GigabitEthernet0/0/1]ip address 34.47.1.1 24
[AR3-GigabitEthernet0/0/1]q
[AR3]isis 
[AR3-isis-1]network-entity 49.000.0000.0000.0003.002
[AR3-isis-1]q
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]isis enable 
[AR3-GigabitEthernet0/0/0]q
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]isis enable 
[AR3-GigabitEthernet0/0/1]q
[AR3]
AR4
<Huawei>system-view 
[Huawei]sysname AR4
[AR4]interface GigabitEthernet 0/0/0
[AR4-GigabitEthernet0/0/0]ip address 24.47.1.2 24
[AR4-GigabitEthernet0/0/0]q
[AR4]interface GigabitEthernet 0/0/1
[AR4-GigabitEthernet0/0/1]ip ad 
[AR4-GigabitEthernet0/0/1]ip address 34.47.1.2 24
[AR4-GigabitEthernet0/0/1]q
[AR4]   
[AR4]interface GigabitEthernet 0/0/2
[AR4-GigabitEthernet0/0/2]ip address 45.47.1.1 24
[AR4-GigabitEthernet0/0/2]q
[AR4]
[AR4]isis   
[AR4-isis-1]network-entity 49.0002.0000.0000.0004.00
[AR4-isis-1]
[AR4-isis-1]is-level level-2
[AR4-isis-1]
[AR4-isis-1]is-level level-1
[AR4-isis-1]
[AR4-isis-1]q
[AR4]   
[AR4]interface GigabitEthernet 0/0/0
[AR4-GigabitEthernet0/0/0]isis enable 
[AR4-GigabitEthernet0/0/0]q
[AR4]   
[AR4]interface GigabitEthernet 0/0/1
[AR4-GigabitEthernet0/0/1]isis enable 
[AR4-GigabitEthernet0/0/1]q
[AR4]
AR5
<Huawei>system-view 
[Huawei]sysname AR5
[AR5]interface GigabitEthernet 0/0/0
[AR5-GigabitEthernet0/0/0]ip address 45.47.1.2 24
[AR5-GigabitEthernet0/0/0]q
[AR5]interface LoopBack 0
[AR5-LoopBack0]ip address 192.47.5.5 24
[AR5-LoopBack0]q
[AR5]
[AR5]isis   
[AR5-isis-1]network-entity 49.0002.0000.0000.0005.00
[AR5-isis-1]is-level level-1
[AR5-isis-1]q
[AR5]interface GigabitEthernet 0/0/0
[AR5-GigabitEthernet0/0/0]isis enable 
[AR5-GigabitEthernet0/0/0]q
[AR5]interface LoopBack 0   
[AR5-LoopBack0]isis enable 
[AR5-LoopBack0]q
[AR5]

查看AR1的路由表有没有学到AR5

华为ensp实验——RIP_组播_07

查看AR4和AR5有没有学到默认路由0.0.0.0

华为ensp实验——RIP_Ethernet_08

华为ensp实验——RIP_组播_09

新需求:172.1路由通过AR2发送

172.2路由通过AR3发送

[AR2]ip ip-prefix AR4 permit 172.47.1.0 24
[AR2]isis 
[AR2-isis-1]import-route isis level-2 into level-1 filter-policy ip-prefix AR4
[AR2-isis-1]q
[AR2]
[AR3]ip ip-prefix AR4 permit 172.47.2.0 24
[AR3]isis
[AR3-isis-1]import-route isis level-2 into level-1 filter-policy ip-prefix AR4
[AR3-isis-1]q
[AR3]

进行查看:

华为ensp实验——RIP_链路_10

ISIS+RIP

拓扑图

华为ensp实验——RIP_Ethernet_11

相关配置

AR1

<Huawei>system-view 
[Huawei]sysname AR1 
[AR1]isis
[AR1-isis-1]network-entity 49.0001.0000.0000.0001.00
[AR1-isis-1]
[AR1-isis-1]q
[AR1]
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.47.1.1 24
[AR1-GigabitEthernet0/0/0]isis enable 
[AR1-GigabitEthernet0/0/0]q
[AR1]
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 13.47.1.1 24
[AR1-GigabitEthernet0/0/1]isis enable 
[AR1-GigabitEthernet0/0/1]q
[AR1]
[AR1]interface LoopBack 0
[AR1-LoopBack0]ip address 1.47.1.1 24
[AR1-LoopBack0]isis enable 
[AR1-LoopBack0]q
[AR1]

AR2

[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.47.1.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.47.1.1 24
[AR2-GigabitEthernet0/0/1]q
[AR2]   
[AR2]isis 
[AR2-isis-1]network-entity 49.0001.0000.0000.0002.00
[AR2-isis-1]q
[AR2]interface GigabitEthernet 0/0/0    
[AR2-GigabitEthernet0/0/0]isis enable 
[AR2-GigabitEthernet0/0/0]q
[AR2]
[AR2]rip
[AR2-rip-1]version 2
[AR2-rip-1]network 24.0.0.0
[AR2-rip-1]q
[AR2]isis
[AR2-isis-1]import-route rip 
[AR2-isis-1]q
[AR2]
[AR2]rip
[AR2-rip-1]import-route isis 
[AR2-rip-1]q
[AR2]

AR3

<Huawei>system-view 
[Huawei]sysname AR3
[AR3]
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.47.1.2 24
[AR3-GigabitEthernet0/0/0]q
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip address 34.47.1.1 24
[AR3-GigabitEthernet0/0/1]q
[AR3]
[AR3]isis 
[AR3-isis-1]network-entity 49.0001.0000.0000.0003.00
[AR3-isis-1]q   
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]isis enable 
[AR3-GigabitEthernet0/0/0]q
[AR3]rip
[AR3-rip-1]version 2
[AR3-rip-1]network 34.0.0.0
[AR3-rip-1]q
[AR3]isis 
[AR3-isis-1]import-route rip 
[AR3-isis-1]q
[AR3]
[AR3]rip
[AR3-rip-1]import-route isis 
[AR3-rip-1]q
[AR3]

AR4

<Huawei>system-view 
[Huawei]sysname AR4
[AR4]interface GigabitEthernet 0/0/0
[AR4-GigabitEthernet0/0/0]ip address 24.47.1.2 24
[AR4-GigabitEthernet0/0/0]q
[AR4]interface GigabitEthernet 0/0/1
[AR4-GigabitEthernet0/0/1]ip ad 
[AR4-GigabitEthernet0/0/1]ip address 34.47.1.2 24
[AR4-GigabitEthernet0/0/1]q
[AR4]
[AR4]interface LoopBack 0
[AR4-LoopBack0]ip address 4.47.4.4 24
[AR4-LoopBack0]q
[AR4]
[AR4]rip
[AR4-rip-1]version 2
[AR4-rip-1]network 24.0.0.0
[AR4-rip-1]network 34.0.0.0
[AR4-rip-1]network 4.0.0.0
[AR4-rip-1]q
[AR4]

进行查看路由检查AR2/AR3是否学到1.47和4.47

[AR2]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       1.47.1.0/24  ISIS-L1 15   10          D   12.47.1.1       GigabitEthernet
0/0/0
       4.47.4.0/24  RIP     100  1           D   24.47.1.2       GigabitEthernet
0/0/1
      12.47.1.0/24  Direct  0    0           D   12.47.1.2       GigabitEthernet
0/0/0
      12.47.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    12.47.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
      13.47.1.0/24  ISIS-L1 15   20          D   12.47.1.1       GigabitEthernet
0/0/0
      24.47.1.0/24  Direct  0    0           D   24.47.1.1       GigabitEthernet
0/0/1
      24.47.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
    24.47.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      34.47.1.0/24  ISIS-L2 15   84          D   12.47.1.1       GigabitEthernet
0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       1.47.1.0/24  ISIS-L1 15   10          D   13.47.1.1       GigabitEthernet
0/0/0
       4.47.4.0/24  ISIS-L2 15   84          D   13.47.1.1       GigabitEthernet
0/0/0
      12.47.1.0/24  ISIS-L1 15   20          D   13.47.1.1       GigabitEthernet
0/0/0
      13.47.1.0/24  Direct  0    0           D   13.47.1.2       GigabitEthernet
0/0/0
      13.47.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    13.47.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
      24.47.1.0/24  ISIS-L2 15   84          D   13.47.1.1       GigabitEthernet
0/0/0
      34.47.1.0/24  Direct  0    0           D   34.47.1.1       GigabitEthernet
0/0/1
      34.47.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
    34.47.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]


【文章原创作者:阜宁网页制作公司 http://www.1234xp.com/funing.html 欢迎留下您的宝贵建议】
上一篇:socket网络编程(二)——实现持续发送
下一篇:没有了
网友评论