Conditionalized static on a Huawei AR router
The Huawei AR routers’ software offers access to a feature called NQA (Network Quality Analysis). NQA is a network performance probe that can be used to collect network information on response time, jitter, packet loss and more.
Aside from using NQA to gather statistics, it is also possible to use NQA in collaboration with the track module. By using NQA in collaboration with the track module, it becomes possible to conditionalize a static route. The static route can be conditionalized to, for example, the reachability of an IP address. As soon as the IP address is no longer reachable, the static route will be removed from the routing-table.
This can be useful as NQA can be tweaked in a lot of different ways. For instance, an issue I ran into not so long ago. We were being 'cost-effecitve' and some further complications were that I could not use BFD. I wanted to conditionally advertise a static route in BGP only if and when a certain destination IP address was reachable from a certain source IP address.
As soon as the server was not reachable anymore, I wanted my AR to stop advertising the route. This way, that the destination 220.127.116.11 could be made available through another route. The other route was learned from another AR router that was given a lower local preference.
First, let’s look the NQA configuration. The following is a simple NQA that will have the router run a never ending test with ICMP;
# nqa test-instance admin icmp test-type icmp destination-address ipv4 18.104.22.168 source-address ipv4 22.214.171.124 frequency 20 vpn-instance 1 start now #
The router will start testing the reachability of 126.96.36.199. By using the ‘display nqa results’, you are able to verify the results of the tests.
After the configuration this NQA, it can be used to collaborate with a static route by configuring the following:
# ip route-static vpn-instance 1 188.8.131.52 255.255.255.255 192.168.1.1 track nqa admin icmp #
The previous configuration command will install the 184.108.40.206/32 static route into the routing-table as long as 192.168.1.1 can be resolved. By adding ‘track nqa admin icmp’ to the static route, it is further enhanced. As soon as the router stops receiving replies from 220.127.116.11, the NQA test will fail. This will result in the 18.104.22.168/32 static route being removed from the AR’s routing table. Because I configured ‘import-route static’ under BGP, the router stopped advertising the subnet as soon as the static route was removed from the routing table.
NQA is offered with an extensive list of available checks. Besides the number of available checks ranging from icmp to http, it is also possible to tweak the check in a lot of different ways. The list of options offered in NQA to too extensive to go through, but be sure to check them out.
Another FYI, I have found the feature to be buggy in several VRP releases. When I used NQA on an AR151, I was using ‘VRP (R) software, Version 5.160 (AR150 V200R005C20SPC100)’.