怎样调整选路最佳

实验拓扑:在这里插入图片描述
IP 配置
R1:

[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.0.0.1 24

[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 13.0.0.1 24

R2:

[R2]interface LoopBack 0
[R2-LoopBack0]ip address 12.0.0.2 24

[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 14.0.0.1 24

R3:

[R3]int LoopBack 0
[R3-LoopBack0]ip address 13.0.0.2 24

[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 15.0.0.1 24

R4:

[R4]int LoopBack 0
[R4-LoopBack0]ip address 4.0.0.1 24

[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 15.0.0.2 24

RIP配置、OSPF配置以及重发布:
R1:

[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 13.0.0.0

R2:

[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 12.0.0.0

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area0
[R2-ospf-1-area-0.0.0.0]network 14.0.0.0 0.0.0.255

R3:

[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 13.0.0.0

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0 
[r3-ospf-1-area-0.0.0.0]network 3.0.0.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 15.0.0.0 0.0.0.255

R4:

[4]ospf 1 router-id 4.4.4.4
[4-ospf-1]area 0
[4-ospf-1-area-0.0.0.0]network 14.0.0.0 0.0.0.255
[4-ospf-1-area-0.0.0.0]network 15.0.0.0 0.0.0.255
[4-ospf-1-area-0.0.0.0]network 4.0.0.0 0.0.0.255

在这里先查看R2 R3的路由表(display ip routing-table)
R2:
在这里插入图片描述
R3 :
在这里插入图片描述
双向重发布
R2

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

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

r3

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

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

紧接着我们调整选路:
R2:

[R2]ip ip-prefix yy permit 15.0.0.0 2
[R2]ip ip-prefix yy permit 3.0.0.0 32
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]rip metricout ip-prefix yy 10
[R2-GigabitEthernet0/0/0]ip ip-prefix dd permit 12.0.0.0 24
[R2]ip ip-prefix dd permit 2.0.0.0 24
[R2]route-policy ddd permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix dd
[R2-route-policy]apply cost-type type-1

[R2-route-policy]q
[R2]route-policy ddd permit  node 20
Info: New Sequence of this List.

[R2-route-policy]q
[R2]ospf 1
[R2-ospf-1]import-route rip route-policy ddd

R3:

[R3]ip ip	
[R3]ip ip-prefix y p	
[R3]ip ip-prefix y permit 14.0.0.0 24

[R3]int	
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]rip m	
[R3-GigabitEthernet0/0/1]rip metricin
[R3-GigabitEthernet0/0/1]rip metricout ip 	
[R3-GigabitEthernet0/0/1]rip metricout ip-prefix y 10
[R3]ip ip-prefix s permit 13.0.0.0 24
[R3]route-policy ss permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match ip-prefix s
[R3-route-policy]apply cost-type type-1
[R3]route-policy ss permit node 20
Info: New Sequence of this List.
[R3]ospf 1
[R3-ospf-1]import-route rip route-policy ss
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值