NQA
拓扑图
实验目的:通过配置NQA路由检测,实现对静态路由的自动切换,保障网络连通性。当网络链路故障时,通过配置的NQA实现主备路径的切换,使PC1和PC2之间的网络链路一直联通。
实验步骤
1.路由器个接口配置ip
R1:
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 13.1.1.1 24
[R1i-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 10.1.1.254 24
[R1-GigabitEthernet0/0/2]q
[R1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.1/24 up up
GigabitEthernet0/0/1 13.1.1.1/24 up up
GigabitEthernet0/0/2 10.1.1.254/24 up up
NULL0 unassigned up up(s)
R2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 24.1.1.1 24
[R2-GigabitEthernet0/0/1]q
[R2]dis
[R2]display ip in
[R2]display ip interface b
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.2/24 up up
GigabitEthernet0/0/1 24.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0
R3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R3
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 13.1.1.1 24
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 34.1.1.1 24
[R3-GigabitEthernet0/0/2]q
[R3]dis
[R3]display ip in
[R3]display ip interface b
[R3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned down down
GigabitEthernet0/0/1 13.1.1.1/24 up up
GigabitEthernet0/0/2 34.1.1.1/24 up up
NULL0 unassigned up up(s)
R4:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 24.1.1.2 24
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 34.1.1.2 24
[R4-GigabitEthernet0/0/2]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.2.254 24
[R4-GigabitEthernet0/0/0]q
[R4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.2.254/24 up up
GigabitEthernet0/0/1 24.1.1.2/24 up up
GigabitEthernet0/0/2 34.1.1.2/24 up up
NULL0 unassigned up up(s)
2.在R1和R4上分别配置NQA:
R1:
[R1]nqa test-instance huawei #创建nqa管理员huawei,cat进程
[R1-nqa-huawei]test-type icmp #协议基于icmp
[R1-nqa-huawei]frequency 5 #5秒发送一次探针
[R1-nqa-huawei]timeout 2 #超过2秒网络故障;注:interval seconds默认时间为4s,timeout时间如果大于4s,则需要调整interval seconds的时间大于timeout,且frequency也需大于timeout时间,不然nqa进程无法启动
[R1-nqa-huawei]threshold rtd 1 #超过1秒代表网络质量不好
[R1-nqa-huawei]probe-count 1 #一次发送1个探针
[R1-nqa-huawei]destination-address ipv4 24.1.1.2 #目的ip
[R1-nqa-huawei]source-address ipv4 12.1.1.1 #源ip
[R1-nqa-huawei]start now #现在开始启动
R2:
[R4]nqa test-instance huawei #创建nqa管理员Kelly,cat进程
[R4-nqa-huawei]test-type icmp #协议基于icmp
[R4-nqa-huawei]frequency 5 #5秒发送一次探针
[R4-nqa-huawei]timeout 2 #超过2秒网络故障;注:interval seconds默认时间为4s,timeout时间如果大于4s,则需要调整interval seconds的时间大于timeout,且frequency也需大于timeout时间,不然nqa进程无法启动
[R4-nqa-huawei]threshold rtd 1 #超过1秒代表网络质量不好
[R4-nqa-huawei]probe-count 1 #一次发送1个探针
[R4-nqa-huawei]destination-address ipv4 12.1.1.1 #目的ip
[R4-nqa-huawei]source-address ipv4 24.1.1.2 #源ip
[R4-nqa-huawei]start now #现在开始启动
3.配置路由器上的静态路由
R1:
[R1]ip route-static 24.1.1.0 24 GigabitEthernet 0/0/0 12.1.1.2 #去往24.1.1.0网络出接口GE0/0/0,下一跳地址12.1.1.2
[R1]ip route-static 172.16.2.1 24 GigabitEthernet 0/0/0 12.1.1.2 track nqa huawei #去往172.16.2.0网络出接口GE0/0/0,下一跳地址12.1.1.2,并调用nqa路由追踪
[R1]ip route-static 172.16.2.1 24 GigabitEthernet 0/0/1 13.1.1.2 preference 70 #备用路径,将优先级调为70,作为备用路由
R2:
[R2]ip route-static 10.1.1.0 24 GigabitEthernet 0/0/0 12.1.1.1
[R2]ip route-static 172.16.2.0 24 GigabitEthernet 0/0/1 24.1.1.2
R3:
[R3]ip route-static 10.1.1.0 24 GigabitEthernet 0/0/1 13.1.1.2
[R3]ip route-static 172.16.2.0 24 GigabitEthernet 0/0/2 34.1.1.2
R4:
[R4]ip route-static 12.1.1.0 24 GigabitEthernet 0/0/1 24.1.1.1
[R4]ip route-static 10.1.1.0 24 GigabitEthernet 0/0/1 24.1.1. track nqa huawei
[R4]ip route-static 10.1.1.0 24 GigabitEthernet 0/0/2 34.1.1.1 preference 70
4.NQA查看命令
[R1]display nqa results #查看nqa结果
display nqa history #查询nqa历史记录