双点双向重发布实验
实验要求
1、使用双点双向重发布
2、所有路由器进行最佳选路
3、存在备份路径,不得出现环路,和路由回馈
R1除本身环回外,外加几条环回
172.16.1.0/24 deny
172.16.2.0/24 type 1
172.16.3.0/24 cost 6
172.16.4.0/24 type 1 cost 9
更改如上参数
实验拓扑图
1、IP地址分配
R1:
R2:
R3:
R4:
2、启动RIP和OSPF协议(给R2、R4配置双点双向重发布)
R1:
R2:
R3:
R4:
检查R1与R3的路由表
发现通往这几条路的路由都是负载均衡。
之所以R3学到两条R4的环回,是因为OSPF学到的是子网掩码为32位的,而RIP学到的是24位的;现在两条路由均已经加表。
解决方法:
[R2-LoopBack0]ospf network-type broadcast
[R4-LoopBack0]ospf network-type broadcast
检查R3:
检查R1:
3、控制选路
先考虑当OSPF向RIP方向重发布
[R2]ip ip-prefix a permit 34.1.1.0 24
[R2]ip ip-prefix a permit 4.4.4.0 24
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]rip metricout ip-prefix a 3
查看R1:
这两条路的负载均衡已经解决
再解决23.1.1.0/24这条路:
[R4]ip ip-prefix a permit 23.1.1.0 24
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/1]rip metricout ip-prefix a 3
查看R1:
成功!
再考虑RIP向OSPF方向重发布
R2上抓12.1.1.0和2.2.2.0的流量,类型改为1(默认为类型2,类型1优于类型2)
[R2]ip ip-prefix b permit 2.2.2.0 24
[R2]ip ip-prefix b permit 12.1.1.0 24
[R2]route-policy xixi permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix b
[R2-route-policy]apply cost-type type-1
[R2-route-policy]q
[R2]route-policy xixi permit node 20
Info: New Sequence of this List.
[R2-route-policy]q
[R2]ospf 1
[R2-ospf-1]import-route rip 1 route-policy xixi
在R4上修改14.1.1.0
[R4]ip ip-prefix b permit 14.1.1.0 24
[R4]route-policy xixi permit node 10
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix b
[R4-route-policy]apply cost-type type-1
[R4-route-policy]q
[R4]route-policy xixi permit node 20
Info: New Sequence of this List.
[R4-route-policy]q
[R4]ospf 1
[R4-ospf-1]import-route rip 1 route-policy xixi
查看R3:
修改成功
查看R1:
4 、修改R1其余环回参数
[R1]ip ip-prefix 1 permit 172.16.1.0 24
[R1]ip ip-prefix 2 permit 172.16.2.0 24
[R1]ip ip-prefix 3 permit 172.16.3.0 24
[R1]ip ip-prefix 4 permit 172.16.4.0 24
[R1]route-policy huawei deny node 10
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix 1
[R1-route-policy]q
[R1]route-policy huawei permit node 20
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix 2
[R1-route-policy]apply cost-type type-1
[R1-route-policy]q
[R1]route-policy huawei permit node 30
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix 3
[R1-route-policy]apply cost 6
[R1-route-policy]q
[R1]route-policy huawei permit node 40
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix 4
[R1-route-policy]apply cost-type type-1
[R1-route-policy]apply cost 9
[R1-route-policy]q
[R1]route-policy huawei permit node 50
Info: New Sequence of this List.
[R1-route-policy]q
实验完成!!!