1.使用双点双向重发布
2.所有路由进行最佳选路
3.存在备份路经,不得出现环路,和路由回馈
步骤一ip规划
R1
interface Serial4/0/0
link-protocol ppp
ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/0/0
ip address 14.1.1.1 255.255.255.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
R2
interface Serial4/0/0
link-protocol ppp
ip address 12.1.1.2 255.255.255.0
interface Serial4/0/1
link-protocol ppp
ip address 23.1.1.2 255.255.255.0
interface LoopBack0
ip address 2.2.2.2 255.255.255.0
R3
interface Serial4/0/0
link-protocol ppp
ip address 34.1.1.3 255.255.255.0
interface Serial4/0/1
link-protocol ppp
ip address 23.1.1.3 255.255.255.0
interface LoopBack0
ip address 3.3.3.3 255.255.255.0
R4
interface Serial4/0/0
link-protocol ppp
ip address 34.1.1.4 255.255.255.0
interface GigabitEthernet0/0/0
ip address 14.1.1.4 255.255.255.0
interface LoopBack0
ip address 4.4.4.4 255.255.255.0
双向重发布
R2
ospf 1
import-route rip 1
rip 1
import-route ospf 1
R4
ospf 1
import-route rip 1
rip 1
import-route ospf 1
此时若要消除子网掩码为32位的环回地址IP,可以将该接口网络类型修改为broadcast 类型。
[R3-LoopBack0]ospf network-type broadcast
修改开销值选路
择优选择去4.0网段的路径
走14网段,剩余路径设置为备份路径,在R2上修改
[R2]ip ip-prefix 1 permit 4.4.4.0 24
[R2]route-policy 1 permit node 10
[R2-route-policy]if-match ip-prefix 1
[R2-route-policy]apply cost + 10
[R2-route-policy]q
[R2]route-policy 1 permit node 20 # 创建空列表
[R2-route-policy]q
[R2]rip 1
[R2-rip-1]import-route ospf 1 route-policy 1 # 重发布时调用
择优选择去32网段的路径
走12网段,剩余路径设置为备份路径,在R4上修改
ip ip-prefix 1 index 10 permit 23.1.1.0 24
route-policy 1 permit node 10
if-match ip-prefix 1
apply cost + 10
#
route-policy 1 permit node 20
#
rip 1
import-route ospf 1 route-policy 1
择优选择去34网段的路径
走14网段,剩余路径设置为备份路径,在R2上修改
[R2]ip ip-prefix 2 permit 34.1.1.0 24
[R2]route-policy 1 permit node 15
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 2
[R2-route-policy]apply cost + 10