运行OSPF协议
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.12.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.13.1 0.0.0.0
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.12.2 0.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 192.168.13.3 0.0.0.0
运行RIP协议
[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]network 192.168.24.0
[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]network 192.168.24.0
[R4-rip-1]network 192.168.34.0
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]network 192.168.34.0
将R1的环回导入到OSPF网络中,不导入两条骨干
[R1]ip ip-prefix ywq permit 1.1.1.0 24
[R1]route-policy QQ permit node 10
[R1-route-policy]if-match ip-prefix ywq[R1-ospf-1]import-route direct route-policy QQ
进行双点双向重发布
[R2-ospf-1]import-route rip 1
[R2-rip-1]import-route ospf 1
[R3-ospf-1]import-route rip 1
[R3-rip-1]import-route ospf 1
消除路由回馈
[R2]ip ip-prefix ywq1 permit 1.1.1.0 24
[R2]route-policy qq1 permit node 10
[R2-route-policy]if-match ip-prefix ywq1
[R2-route-policy]apply preference 90
[R2-ospf-1]preference ase route-policy qq1
[R3]ip ip-prefix ywq1 permit 1.1.1.0 24
[R3]route-policy qq1 permit node 10
[R3-route-policy]if-match ip-prefix ywq1
[R3-route-policy]apply preference 90
[R3-ospf-1]preference ase route-policy qq1
解决选路不佳(不恰当的负载均衡),做备份
查看R4和R1的路由表
[R2]ip ip-prefix ywq10 permit 192.168.34.0 24
[R2]route-policy ywq11 permit node 10
[R2-route-policy]if-match ip-prefix ywq10
[R2-route-policy]apply cost 10
[R2-ospf-1]import-route rip 1 route-policy ywq11
[R2]route-policy ywq11 permit node 20[R3]ip ip-prefix ywq10 permit 192.168.24.0 24
[R3]route-policy ywq11 permit node 10
[R3-route-policy]if-match ip-prefix ywq10
[R3-route-policy]apply cost 10
[R3-route-policy]route-policy ywq11 permit node 20
[R3-ospf-1]import-route rip 1 route-policy ywq11