文章目录
- NQA配置介绍
- 实验说明
NQA配置介绍
- NQA配置
nqa entry admin test
type icmp-echo //配置NQA类型
destination ip 10.1.0.1 //配置探测的目的IP
source ip 10.1.0.2 //配置探测的源IP
frequency 6000 //配置探测的时间
history-record enable //历史探测记录
history-record number 10 //历史探测记录10条
probe count 3 //探测次数
probe timeout 2000 //探测超时时间
reaction 3 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
# 配置track项
track 1 nqa entry admin test reaction 3
# 激活NQA
nqa schedule admin test start-time now lifetime forever
- 静态路由调用track
ip route-static 1.1.1.1 32 10.1.0.1 track 1
ip route-static 1.1.1.1 32 10.1.0.1 preference 100
- 查看NQA状态
[H3C]dis track all
Track ID: 1
State: Positive
Duration: 0 days 0 hours 1 minutes 38 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 3
Remote IP/URL: 10.1.0.1
Local IP: 10.1.0.2
Interface: --
[H3C]
- 如果状态为
NotReady
,NQA则不生效,有可能是再配置NQA是,探测类型配置为了trap-only
修改为trigger-only
即可
- 在中间互联的接口down或这探测报文无法通过时,6s后就会进行切换,保证路由从备路由走
实验说明
- SW1与SW2三层互联,主链路中间串联二层防火墙,备链路直接互通
- 配置如下
# SW1
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
interface Ten-GigabitEthernet1/0/49
port link-mode route
ip address 10.1.0.1 255.255.255.252
interface Ten-GigabitEthernet1/0/50
port link-mode route
ip address 10.1.0.5 255.255.255.252
# SW2
interface Ten-GigabitEthernet1/0/49
port link-mode route
ip address 10.1.0.2 255.255.255.252
interface Ten-GigabitEthernet1/0/50
port link-mode route
ip address 10.1.0.6 255.255.255.252
nqa entry admin test
type icmp-echo
destination ip 10.1.0.1
source ip 10.1.0.2
frequency 6000
history-record enable
history-record number 10
probe count 3
probe timeout 2000
reaction 3 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
#
track 1 nqa entry admin test reaction 3
#
nqa schedule admin test start-time now lifetime forever
#
ip route-static 1.1.1.1 32 10.1.0.1 track 1
ip route-static 1.1.1.1 32 10.1.0.1 preference 100
- 防火墙可以用二层交换机代替,可以通过断开中间设备与SW1互联的接口判断NQA是否生效
- 也可以在中间设备上配置ACL,禁止NQA的探测报文,再查看NQA是否切换
- 配置如下
acl advanced 3000
rule 5 deny icmp source 10.1.0.2 0 destination 10.1.0.1
interface Ten-GigabitEthernet 1/0/49
packet-filter 3000 outbound
- 已经完成切换,从备出口(XGE1/0/50)发出
[H3C]dis track all
Track ID: 1
State: Positive
Duration: 0 days 0 hours 1 minutes 38 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 3
Remote IP/URL: 10.1.0.1
Local IP: 10.1.0.2
Interface: --
[H3C]dis ip routing-table
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.1/32 Static 60 0 10.1.0.1 XGE1/0/49
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
10.1.0.0/30 Direct 0 0 10.1.0.2 XGE1/0/49
10.1.0.0/32 Direct 0 0 10.1.0.2 XGE1/0/49
10.1.0.2/32 Direct 0 0 127.0.0.1 InLoop0
10.1.0.3/32 Direct 0 0 10.1.0.2 XGE1/0/49
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[H3C]%Jan 1 08:56:49:182 2013 H3C PING/6/PING_STATISTICS: Ping statistics for 10.1.0.1: 4 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss.
[H3C]dis track all
Track ID: 1
State: Negative
Duration: 0 days 0 hours 0 minutes 19 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Tracked object:
NQA entry: admin test
Reaction: 3
Remote IP/URL: 10.1.0.1
Local IP: 10.1.0.2
Interface: --
[H3C]dis ip routing-table
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.1/32 Static 100 0 172.31.16.229 XGE1/0/50
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
10.1.0.0/30 Direct 0 0 10.1.0.2 XGE1/0/49
10.1.0.0/32 Direct 0 0 10.1.0.2 XGE1/0/49
10.1.0.2/32 Direct 0 0 127.0.0.1 InLoop0
10.1.0.3/32 Direct 0 0 10.1.0.2 XGE1/0/49
172.31.16.228/30 Direct 0 0 172.31.16.230 XGE1/0/50
172.31.16.228/32 Direct 0 0 172.31.16.230 XGE1/0/50
172.31.16.230/32 Direct 0 0 127.0.0.1 InLoop0
172.31.16.231/32 Direct 0 0 172.31.16.230 XGE1/0/50
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[H3C]
以上内容均属原创,如有不详或错误,敬请指出。
本文链接: https://blog.csdn.net/qq_45668124/article/details/145835773
版权声明: 本博客所有文章除特别声明外,如需转载,请联系作者注明出处并附带本文链接!