路由策略实验

实验拓扑

在这里插入图片描述

实验要求

1,两个协议间进行多点双向重发布
2。R7的环回没有宣告在OSPF协议中,而是后期重发布进入的
3、释决坏路,所有路径选挥最优,且存在备份

实验配置

1.先配置IP和环回

[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 22.1.1.1 24
[R1-GigabitEthernet0/0/1]q
[R1]int l 0
[R1-LoopBack0]ip add 1.1.1.1 24
其他同理

2.添加路由协议

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 1.0.0.0
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 22.0.0.0

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 2.0.0.0
[R2-rip-1]q
[R2]ospf 1
[R2-ospf-1]area
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 32.1.1.1 0.0.0.0

[R4]ospf 1
[R4-ospf-1]area
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
R5,R6同理

[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 72.1.1.2 0.0.0.0

3.把R7的环回导入

[R7]ospf 1
[R7-ospf-1]import-route direct

4.把R2,R3上做重发布

[R2]ospf 1
[R2-ospf-1]import-route rip
[R2]rip 1
[R2-rip-1]import-route ospf 1

[R3]ospf 1
[R3-ospf-1]import-route rip
[R3]rip
[R3-rip-1]import-route ospf 1

5.将R1发给R3的路由优先级改为151

[R3]ip ip-prefix a index 10 permit 7.7.7.0 24
[R3]route-policy qq permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match ip-prefix a
[R3-route-policy]apply preference 151
[R3-route-policy]q
[R3]rip 1
[R3-rip-1]preference route-policy qq

6.如果R2R4线路断,重连后发现R7环回会通过优先级为100的R1到R2路线,和R3上同理配置优先级

[R2]ip ip-prefix a permit 7.7.7.0 24
[R2]route-policy qq permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix a
[R2-route-policy]apply preference 151
[R2-route-policy]q
[R2]rip 1
[R2-rip-1]preference route-policy qq

9.选路最优

[R3-LoopBack0]ip add 3.3.3.3 32
加度量
[R3]ip ip-prefix we permit 32.1.1.0/ 24
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]rip metricin ip-
[R3-GigabitEthernet0/0/0]rip metricin ip-prefix we 2

[R2]ip ip-prefix er permit 3.3.3.3 32
[R2]ip ip-prefix er permit 42.1.1.0 24
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/1]ri
[R2-GigabitEthernet0/0/1]rip metricout ip-prefix er 2

[R2]ip ip-prefix rr permit 12.1.1.0 24
[R2]ip ip-prefix rr permit 2.2.2.0 24
[R2]route-policy rr permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix rr
[R2-route-policy]apply cost-type type-1
[R2-route-policy]q
[R2]route-policy rr permit node 20
Info: New Sequence of this List.
[R2-route-policy]q
[R2]ospf 1
[R2-ospf-1]import-route rip route-policy rr

[R3]ip ip-prefix rr permit 22.1.1.0 24
[R3]route-policy rr permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match ip-prefix rr
[R3-route-policy]apply cost-type type-1
[R3-route-policy]q
[R3]route-policy rr permit node 20
Info: New Sequence of this List.
[R3-route-policy]q
[R3]ospf 1
[R3-ospf-1]import-route rip route-policy rr
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值