GR配置举例

1.组网需求  

·     Switch A、Switch B和Switch C既属于同一自治系统,也属于同一OSPF域,通过OSPF协议实现网络互连,并提供GR机制。

·     Switch A作为非IETF标准GR Restarter,Switch B和Switch C作为GR Helper并且通过GR机制与Switch A保持带外同步。

   

2.配置

  1)配置OSPF基本功能  

SW A
[SwitchA] router id 1.1.1.1
[SwitchA] ospf 100
[SwitchA-ospf-100] area 0
[SwitchA-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

SW B
[SwitchB] router id 2.2.2.2
[SwitchB] ospf 100
[SwitchB-ospf-100] area 0
[SwitchB-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

SW C
[SwitchC] router id 3.3.3.3
[SwitchC] ospf 100
[SwitchC-ospf-100] area 0
[SwitchC-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

  2)配置OSPF GR  

[SwitchA] ospf 100
[SwitchA-ospf-100] enable link-local-signaling
[SwitchA-ospf-100] enable out-of-band-resynchronization
[SwitchA-ospf-100] graceful-restart  # 配置Switch A作为非IETF标准GR Restarter,即使能OSPF进程100的本地链路信令能力、OSPF带外同步能力和非IETF标准GR能力。

[SwitchB] ospf 100
[SwitchB-ospf-100] enable link-local-signaling
[SwitchB-ospf-100] enable out-of-band-resynchronization  # 配置Switch B作为GR Helper,即使能OSPF进程100的本地链路信令能力和OSPF带外同步能力。

[SwitchC] ospf 100
[SwitchC-ospf-100] enable link-local-signaling
[SwitchC-ospf-100] enable out-of-band-resynchronization  # 配置Switch C作为GR Helper,即使能OSPF进程100的本地链路信令能力和OSPF带外同步能力。

3.验证配置

# 打开Switch A的OSPF平滑启动事件调试信息开关。在Switch A上以GR方式重启OSPF进程。

<SwitchA> debugging ospf event graceful-restart
<SwitchA> terminal monitor
<SwitchA> terminal logging level 7
<SwitchA> reset ospf 100 process graceful-restart
Reset OSPF process? [Y/N]:y
%Oct 21 15:29:28:727 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Full to Down.
%Oct 21 15:29:28:729 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Full to Down.
*Oct 21 15:29:28:735 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 nonstandard GR Started for OSPF Router
*Oct 21 15:29:28:735 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 created GR wait timer,timeout interval is 40(s).
*Oct 21 15:29:28:735 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 created GR Interval timer,timeout interval is 120(s).
*Oct 21 15:29:28:758 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 created OOB Progress timer for neighbor 192.1.1.3.
*Oct 21 15:29:28:766 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 created OOB Progress timer for neighbor 192.1.1.2.
%Oct 21 15:29:29:902 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Loading to Full.
*Oct 21 15:29:29:902 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.2.
%Oct 21 15:29:30:897 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Loading to Full.
*Oct 21 15:29:30:897 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.3.
*Oct 21 15:29:30:911 2019 SwitchA OSPF/7/DEBUG:
OSPF GR: Process 100 Exit Restart,Reason : DR or BDR change,for neighbor : 192.1.1.3.
*Oct 21 15:29:30:911 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 deleted GR Interval timer.
*Oct 21 15:29:30:912 2019 SwitchA OSPF/7/DEBUG:
OSPF 100 deleted GR wait timer.
%Oct 21 15:29:30:920 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Full to Down.
%Oct 21 15:29:30:921 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Full to Down.
%Oct 21 15:29:33:815 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Loading to Full.
%Oct 21 15:29:35:578 2019 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Loading to Full.  
从上面的信息可以看出Switch A完成了GR。

NSR配置举例

1.Switch S、Switch A、Switch B属于同一OSPF区域,通过OSPF协议实现网络互连。要求对Switch S进行主备倒换时,Switch A和Switch B到Switch S的邻居没有中断,Switch A到Switch B的流量没有中断。

    

2.配置

  1)配置各路由器接口的IP地址和OSPF协议 

  配置各交换机之间采用OSPF协议进行互连,确保Switch S、Switch A和Switch B之间能够在网络层互通,并且各交换机之间能够借助OSPF协议实现动态路由更新。

  2)配置OSPF NSR  

[SwitchS] ospf 100
[SwitchS-ospf-100] non-stop-routing  # 使能Switch S的OSPF NSR功能。

3.配置验证  

# Switch S进行主备倒换。
[SwitchS] placement reoptimize
Predicted changes to the placement
Program                           Current location       New location
---------------------------------------------------------------------
rib                               0/0                    0/0
staticroute                       0/0                    0/0
ospf                              0/0                    1/0
Continue? [y/n]:y
Re-optimization of the placement start. You will be notified on completion.
Re-optimization of the placement complete. Use 'display placement' to view the new placement.

  

# 查看Switch A/B上OSPF协议的邻居和路由。
<SwitchA> display ospf peer
          OSPF Process 1 with Router ID 2.2.2.1
               Neighbor Brief Information
 Area: 0.0.0.0
 Router ID       Address         Pri Dead-Time  State             Interface
 3.3.3.1         12.12.12.2      1   37         Full/BDR          Vlan100

<SwitchA> display ospf routing
          OSPF Process 1 with Router ID 2.2.2.1
                   Routing Table
                Topology base (MTID 0)
 Routing for network
 Destination        Cost     Type    NextHop         AdvRouter       Area
 44.44.44.44/32     2        Stub    12.12.12.2      4.4.4.1         0.0.0.0
 14.14.14.0/24      2        Transit 12.12.12.2      4.4.4.1         0.0.0.0
 22.22.22.22/32     0        Stub    22.22.22.22     2.2.2.1         0.0.0.0
 12.12.12.0/24      1        Transit 12.12.12.1      2.2.2.1         0.0.0.0

 Total nets: 4
 Intra area: 4  Inter area: 0  ASE: 0  NSSA: 0

  通过上面信息可以看出在Switch S发生主备倒换的时候,Switch A和Switch B的邻居和路由信息保持不变,从Switch A到Switch B的流量转发没有受到主备倒换的影响。

 

posted on 2021-12-09 15:51  星痕1216  阅读(1419)  评论(0编辑  收藏  举报