重发布和路由策略----调整选路最佳

1.IP的分配 

2.配置动态路由协议

R1

[r1-rip-1]display this
[V200R003C00]
#
rip 1
 version 2
 network 1.0.0.0
 network 12.0.0.0
 network 13.0.0.0
#
return

R2

[r2-rip-1]display this 
[V200R003C00]
#
rip 1
 version 2
 network 12.0.0.0
 network 2.0.0.0
#
return

[r2-ospf-1]display  this 
[V200R003C00]
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 24.0.0.0 0.0.0.255 
#
return                                   

R3

 [r3-rip-1]display this 
[V200R003C00]
#
rip 1
 version 2
 network 13.0.0.0
#
return

[r3-ospf-1]display this 
[V200R003C00]
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 34.0.0.0 0.0.0.255 
#
return

R4

[r4-ospf-1]display this 
[V200R003C00]
#
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 24.0.0.0 0.0.0.255 
  network 34.0.0.0 0.0.0.255 
#
return

3.重发布

R2

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

 R3

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

其中有两条去往3.3.3.0的网段 ,分别来自R2和R3的重发布,一条来自R2重发布的下一跳为12.0.0.2,另一条为R3重发布的下一跳为13.0.0.2

 

通过R2的路由信息观察到去往3.3.3.0的网段有两个方向,很可能会造成选路不佳。

解决方法是 

	
[r3]interface LoopBack 0	
[r3-LoopBack0]ospf network-type broadcast 

 

4.路由策略

使用路由策略解决负载均衡 

 

R2

[r2]ip ip-prefix a permit 34.0.0.0 24	
[r2]ip ip-prefix a permit 3.3.3.0 24
[r2]ip ip-prefix a permit 13.0.0.0 24
[r2]route-policy b permit node 10
Info: New Sequence of this List.
[r2-route-policy]if-match ip-prefix b
[r2-route-policy]apply cost 10
[r2]route-policy b permit node 20
Info: New Sequence of this List.
[r2]ospf
[r2-ospf-1]import-route rip route-policy b
[r2-rip-1]import-route ospf route-policy a

 R3

[r3]ip ip-prefix b permit 12.0.0.0 24
[r3]ip ip-prefix b permit 2.2.2.0 24
[r3]route-policy b permit node 10
Info: New Sequence of this List.	
[r3-route-policy]if-match ip-prefix b
[r3-route-policy]apply cost 10
[r3]ip ip-prefix a permit 24.0.0.0 24
[r3]route-policy a permit node 10
Info: New Sequence of this List.
[r3-route-policy]if-match ip-prefix a
[r3-route-policy]apply cost 10
[r3]route-policy a permit node 20
Info: New Sequence of this List.
[r3-rip-1]import-route ospf route-policy a	
[r3]ospf
[r3-ospf-1]import-route rip route-policy b

 

 

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值