实验介绍

深入理解OSPF IP快速重路由技术。

实验目的

在全网部署并运行OSPF路由协议,按上图所示调整设备接口的 Cost 值,使得从R1到网络192.168.1.0的主路径为R1 → R3 → R4。在R1上启用OSPF的IP FRR功能,以便在R1与R3之间的链路发生故障时,R1能够快速将流量切换至通过 R2的备份链路进行转发。

拓扑结构

OSPF FRR (二).png

接口信息

路由器

接口

IP Address/Mask

Cost

R1

GE 0/0/0

10.1.1.1/24

15

GE 0/0/1

20.1.1.1/24

10

R2

GE 0/0/1

10.1.1.2/24

15

GE 0/0/0

30.1.1.2/24

5

R3

GE 0/0/0

20.1.1.3/24

10

GE 0/0/1

40.1.1.3/24

5

R4

GE 0/0/0

40.1.1.4/24

5

GE 0/0/1

30.1.1.4/24

5

LoopBack 0

192.168.1.4/24

实验步骤

步骤一:配置IP和Cost值

[R1-GigabitEthernet0/0/0]dis th
[V200R003C00]
#
interface GigabitEthernet0/0/0
 ip address 10.1.1.1 255.255.255.0
 ospf cost 10
#
return
[R1-GigabitEthernet0/0/1]dis th
[V200R003C00]
#
interface GigabitEthernet0/0/1
 ip address 20.1.1.1 255.255.255.0
 ospf cost 10
#
return

步骤二:配置OSPF

[R1-ospf-1]dis th
[V200R003C00]
#
ospf 1
 area 0.0.0.0
  network 10.1.1.0 0.0.0.255
  network 20.1.1.0 0.0.0.255
#
return

步骤三:在R1上部署FRR

[R1-ospf-1]frr
[R1-ospf-1-frr]loop-free-alternate

步骤四:在R1和R3上分别开启BFD并调用

[R1]bfd
[R1-bfd]q
[R1]ospf 1
[R1-ospf-1]bfd all-interfaces enable
[R1-ospf-1]bfd all-interfaces min-rx-interval 10 min-tx-interval 10 frr-binding
[R3]bfd
[R3-bfd]ospf 1
[R3-ospf-1]bfd all-interfaces enable
[R3-ospf-1]bfd all-interfaces min-rx-interval 10 min-tx-interval 10
[R3-ospf-1]

测试

[R1]display ospf routing 192.168.1.4

         OSPF Process 1 with Router ID 10.1.1.1

 Destination : 192.168.1.4/32
 AdverRouter : 40.1.1.4                 Area      : 0.0.0.0
 Cost        : 15                       Type      : Stub
 NextHop     : 20.1.1.3                 Interface : GigabitEthernet0/0/1
 Priority    : Medium                   Age       : 00h04m30s
 Backup Nexthop : 10.1.1.2              Backup Interface: GigabitEthernet0/0/0
 Backup Type : LFA LINK-NODE