国家 / 地区

H3C MSR系列路由器典型配置举例(V5)-6W100

52-MSR系列路由器VRRP与NQA联动的典型配置举例

本章节下载  (156.57 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/MSR/MSR_50/Configure/Typical_Configuration_Example/H3C_MSR_(V5)-6W100/201401/812763_30005_0.htm

52-MSR系列路由器VRRP与NQA联动的典型配置举例

MSR系列路由器VRRP与NQA联动的典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H3C_彩色.emf

 



1  简介

本文主要介绍了VRRP与NQA联动典型配置。

2  配置前提

本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解NQA和VRRP特性。

3  配置举例

3.1  组网需求

图1所示,Host主机需要访问Router C ,Host的缺省网关为172.32.20.1/24;Router A和Router B属于虚拟IP地址为172.32.20.99/24的备份组11;当Router A正常工作时,Host发送给Router C的报文通过Router A转发;当Router A出现故障时,Host发送给Router C的报文通过Router B转发。

图1 VRRP与NQA联动典型配置举例

 

3.2  配置思路

·     为使能NQA,创建track项关联NQA和VRRP;

·     为使RouterB作为备份,设置备份组的IP需与RouterA上的一致,且优先级较低。

·     为使能PPPOE,配置RouterA上的PPPOE server和Router C上的PPPOE Client功能。

3.3  使用版本

本举例是在Release 2207P14版本上进行配置和验证的。

3.4  配置注意事项

·     在配置VRRP监视Track项之前,需要先在接口上创建备份组并配置虚拟IP地址。

·     不允许对IP地址拥有者进行监视指定Track项的配置。

·     被监视Track项的状态由Negative变为Positive后,对应的路由器优先级会自动恢复。

·     被监视的Track项可以是未创建的Track项。可以通过vrrp vrid track命令指定监视的Track项后,再通过track命令创建该Track项。

3.5  配置步骤

3.5.1  Router A的配置

# 在Router A上创建管理员名为admin、操作标签为test的NQA测试组,并配置测试类型为ICMP-echo

<RouterA>system-view

[RouterA]nqa entry admin test

[RouterA-nqa-admin-test]type icmp-echo 

[RouterA-nqa-admin-test-icmp-echo]destination ip 1.1.1.2

[RouterA-nqa-admin-test-icmp-echo]frequency 1000

# 配置Reaction监测项1(失败1次触发联动)

[RouterA-nqa-admin-test-icmp-echo]reaction 1 checked-element probe-fail threshold-type consecutive 1 action-type trigger-only

[RouterA-nqa-admin-test-icmp-echo]quit

# 配置Track项1,关联NQA测试组(管理员为admin,操作标签为 icmp)的Reaction监测项1

[RouterA]track 1 nqa entry admin test reaction 1

# 启动NQA测试项

[RouterA]nqa schedule admin test start-time now lifetime forever

# 在Router A上配置VRRP,创建备份组11,并配置备份组11的虚拟IP地址为172.32.20.99

[RouterA]interface Ethernet 0/0

[RouterA-Ethernet0/0]vrrp vrid 11 virtual-ip 172.32.20.99

# 设置Router A在备份组11中的优先级为110

[RouterA-Ethernet0/0]vrrp vrid 11 priority 110

# 设置Router A工作在抢占方式,抢占延迟时间为5秒

[RouterA-Ethernet0/0]vrrp vrid 11 preempt-mode timer delay 5

# 设置监视Track项

[RouterA-Ethernet0/0]vrrp vrid 11 track 1 reduced 30

# 配置以太口Ethernet0/0的IP地址

[RouterA-Ethernet0/0]ip address 172.32.20.95 255.255.255.0

[RouterA-Ethernet0/0]quit

# 配置PPPOE server端的相关配置

[RouterA]interface Virtual-Template 1

[RouterA-Virtual-Template1]ip address 1.1.1.1 255.255.255.0

[RouterA-Virtual-Template1]remote address 1.1.1.2

[RouterA-Virtual-Template1]quit

[RouterA]interface Ethernet 0/1

[RouterA-Ethernet0/1]pppoe-server bind Virtual-Template 1

3.5.2  Router B的配置

# 在Router B上配置VRRP,创建备份组11,并配置备份组11的虚拟IP地址为172.32.20.99

<RouterB>system-view

[RouterB]interface Ethernet 0/0 

[RouterB-Ethernet0/0]vrrp vrid 11 virtual-ip 172.32.20.99

# 设置Router B工作在抢占方式,抢占延迟时间为5秒

[RouterB-Ethernet0/0]vrrp vrid 11 preempt-mode timer delay 5

# 配置以太口Ethernet0/0的IP地址

[RouterB-Ethernet0/0]ip address 172.32.20.96 255.255.255.0

[RouterB-Ethernet0/0]quit

# 配置以太口Ethernet0/1的IP地址

[RouterB]interface Ethernet 0/1

[RouterB-Ethernet0/1]ip address 2.2.2.1 255.255.255.0

3.5.3  Router C的配置

# 配置PPPOE CLIENT端的基本配置

<RouterC>system-view 

[RouterC]interface Dialer 1    

[RouterC-Dialer1]ip address ppp-negotiate

[RouterC-Dialer1]dialer user pppoe

[RouterC-Dialer1]dialer-group 1

[RouterC-Dialer1]dialer bundle 1

[RouterC-Dialer1]quit  

[RouterC]interface GigabitEthernet 0/0

[RouterC-GigabitEthernet0/0]pppoe-client dial-bundle-number 1   

[RouterC-GigabitEthernet0/0]quit

# 配置以太口GigabitEthernet 0/1IP地址

[RouterC]interface GigabitEthernet 0/1

[RouterC-GigabitEthernet0/1]ip address 2.2.2.2 255.255.255.0

3.6  验证配置

(1)     配置完成后,通过display vrrp命令查看配置后的结果。

# 显示Router A上备份组11的详细信息

[RouterA]display vrrp verbose

 IPv4 Standby Information:

 Run Mode       : Standard 

 Run Method      : VIRTUAL-MAC

Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Master

 Config Pri      : 110                  Run Pri         : 110

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

Virtual IP      : 172.32.20.99

 Virtual MAC     : 0000-5e00-010b

 Master IP       : 172.32.20.95

VRRP Track Information:

 Track Object    : 1                    State:Positive       Pri Reduced     : 30

# 显示Router B上备份组11的详细信息

[RouterB]display vrrp verbose

 IPv4 Standby Information:

 Run Mode       : Standard 

 Run Method      : VIRTUAL-MAC

Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Backup

 Config Pri      : 100                  Run Pri         : 100

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

 Virtual IP      : 172.32.20.99

 Master IP       : 172.32.20.95

(2)     这时断开RouterA与RouterC之间的线缆,在RouterA上查看NQA测试结果,显示ICMP测试不成功,NQA将探测结果通知给TRACK模块,则对应Track项的状态为negative,于是VRRP备份组11进行了主备切换

[RouterA]

%Sep 30 14:09:10:537 2011 RouterA VRRP/6/VRRP_STATUS_CHANGE: The status of IPv4 virt

ual router 11 (configured on Ethernet0/0) changed from Master to backup:

Received VRRP packet 

[RouterA]display nqa result admin test

  NQA entry(admin admin, tag test) test results:

    Destination IP address: 1.1.1.2

      Send operation times: 1              Receive response times: 0

      Min/Max/Average round trip time: 0/0/0

      Square-Sum of round trip time: 0

      Last succeeded probe time: 0-00-00 00:00:00.0

    Extend results:

      Packet lost in test: 100%

      Failures due to timeout: 1

      Failures due to disconnect: 0

      Failures due to no connection: 0

      Failures due to sequence error: 0

      Failures due to internal error: 0

      Failures due to other errors: 0     

      Packet(s) arrived late: 0

 

[RouterA]display track 1

Track ID: 1

  Status: Negative

  Duration: 0 days 0 hours 12 minutes 7 seconds

  Notification delay: Positive 0, Negative 0 (in seconds)

  Reference object:

    NQA entry: admin test

    Reaction: 1      

 

[RouterA]display vrrp verbose

 IPv4 Standby Information:

 Run Mode       : Standard 

 Run Method      : VIRTUAL-MAC

Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Backup

 Config Pri      : 110                  Run Pri         : 80

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

Virtual IP      : 172.32.20.99

 Master IP       : 172.32.20.96

VRRP Track Information:

 Track Object    : 1                    StateNegative       Pri Reduced     : 30

# Router A与Router C不通时,通过display vrrp命令查看Router B上备份组11的详细信息

%Sep 30 14:09:10:537 2011 RouterB VRRP/6/VRRP_STATUS_CHANGE: The status of IPv4 virt

ual router 11 (configured on Ethernet0/0) changed from Backup to Master:

Timer expired. 

[RouterB]display vrrp verbose

 IPv4 Standby Information:

 Run Mode       : Standard

 Run Method      : VIRTUAL-MAC

 Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Master

 Config Pri      : 100                  Run Pri         : 100

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

 Virtual IP      : 172.32.20.99

 Master IP       : 172.32.20.96   

(3)     恢复RouterA与RouterC之间的电缆连接,监视Track项的状态由Negative变为Positive后,这时RouterA和RouterB上的VRRP备份组11又进行了主备状态切换,通过display vrrp命令查看RouterA和Router B上备份组11的详细信息,发现RouterA上的路由器优先级会自动恢复

%Sep 30 14:09:10:537 2011 RouterA VRRP/6/VRRP_STATUS_CHANGE: The status of IPv4 virt

ual router 11 (configured on GigabitEthernet0/0) changed from Backup to Master:

Timer expired. 

[RouterA]display vrrp verbose

 IPv4 Standby Information:

 Run Mode       : Standard

 Run Method      : VIRTUAL-MAC

Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Master

 Config Pri      : 110                  Run Pri         : 110

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

 Virtual IP      : 172.32.20.99

 Master IP       : 172.32.20.95     

VRRP Track Information:

 Track Object    : 1                    State:Positive       Pri Reduced     : 30

 

%Sep 30 14:09:10:537 2011 RouterB VRRP/6/VRRP_STATUS_CHANGE: The status of IPv4 virt

ual router 11 (configured on GigabitEthernet0/0) changed from Master to Backup:

Received VRRP packet

 [RouterB]display vrrp verbose

 IPv4 Standby Information:

 Run Method      : VIRTUAL-MAC

 Run Mode       : Standard

Total number of virtual routers: 1

 Interface       : Ethernet0/0

 VRID            : 11                   Adver. Timer    : 1

 Admin Status    : UP                   State           : Backup

 Config Pri      : 100                  Run Pri         : 100

 Preempt Mode    : YES                  Delay Time      : 5

 Auth Type       : NONE

 Virtual IP      : 172.32.20.99

 Master IP       : 172.32.20.95

3.7  配置文件

·     Router A

#

 sysname RouterA

#

interface Ethernet0/0

 port link-mode route

 ip address 172.32.20.95 255.255.255.0

 vrrp vrid 11 virtual-ip 172.32.20.99

 vrrp vrid 11 priority 110

 vrrp vrid 11 preempt-mode timer delay 5

 vrrp vrid 11 track 1 reduced 30

#

interface Ethernet0/1

 port link-mode route

 pppoe-server bind Virtual-Template 1

#

interface Virtual-Template1

 remote address 1.1.1.2

 ip address 1.1.1.1 255.255.255.0

#

nqa entry admin test

 type icmp-echo

  destination ip 1.1.1.2

  frequency 1000

  reaction 1 checked-element probe-fail threshold-type consecutive 1 action-type trigger-only

#

 track 1 nqa entry admin test reaction 1

#

 nqa schedule admin test start-time now lifetime forever

#

·     Router B

#

 sysname RouterB

#

interface Ethernet0/0

 port link-mode route

 ip address 172.32.20.96 255.255.255.0

 vrrp vrid 11 virtual-ip 172.32.20.99

 vrrp vrid 11 preempt-mode timer delay 5

#

interface Ethernet0/1

 port link-mode route

 ip address 2.2.2.1 255.255.255.0

#

·     Router C

#

 sysname RouterC

#

interface Dialer1

 link-protocol ppp

 ip address ppp-negotiate

 dialer user pppoe

 dialer-group 1

 dialer bundle 1

#

interface NULL0

#

interface GigabitEthernet0/0

 port link-mode route

 pppoe-client dial-bundle-number 1

#

interface GigabitEthernet0/1

 port link-mode route

 ip address 2.2.2.2 255.255.255.0

#

4  相关资料

·     H3C MSR 系列路由器 命令参考(V5)-R2311

·     H3C MSR 系列路由器 配置指导(V5)-R2311

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!