When configuring IPSec intelligent link selection profiles, comply with the following principles:
By default, an IPSec intelligent link selection profile is enabled.
The IPSec intelligent link selection function can be used in two scenarios based on the link switchover mechanism. One is to switch the link based on the link quality probe result, and the other is to switch the link based on the route status change.
Run the link link-id interface interface-type interface-number [ local local-address ] [ nexthop nexthop-address ] remote remote-address command to add links for IPSec intelligent link selection.
Each IPSec intelligent link selection profile allows a maximum of 3 local addresses and a maximum of 10 peer addresses. Therefore, you can configure a maximum of 30 links (3 x 10 = 30). A link configured earlier is given a higher priority than that of a link configured later. You can use the move link command to adjust the proprieties of links and use the active link command to manually select an IPSec link.
After the IPSec link is selected, the FW will apply the IPSec policy that references the IPSec intelligent link selection profile to the local interface specified in the link command. In addition, the FW replaces the local address and remote address with those specified in the local-address and remote-address parameters of the link command respectively.
To correctly forward IKE negotiation packets and IPSec packets, the FW will deliver a host route with the destination address of remote-address and next-hop address of nexthop-address. nexthop nexthop-address and remote remote-address are specified in the link command.
When the local interface obtains IP addresses through DHCP or PPPoE, local-address and nexthop-address are obtained from the DHCP or PPPoE server. You do not need to set values for them. If you manually set values for local-address and nexthop-address, the FW will use the values that you set.
To correctly forward private network packets and link quality probe packets, you need to configure the reverse route injection function on the gateway that uses the IPSec intelligent link selection function.
Quality of IPSec links is detected by sending ICMP packets. source-address can be any address as long as the remote device and source-address are reachable to each other. The destination-address of probe packets may be the address of a device on the peer private network. When there is only one peer address, the destination-address of probe packets may be an interface IP address of the peer gateway.
After you specify the source and destination addresses for link quality detection packets using the link-quality-detection source source-address destination destination-address command, the FW will automatically add the following profile to the ACL referenced by the IPSec policy so that the link quality detection packets match the ACL.
rule permit icmp source source-address 0 destination destination-address 0
If link quality detection packets match an existing ACL rule on the FW, the FW will not add the preceding ACL rule.
The following ACL rule needs to be manually added to the remote device so that the remote device can receive and respond to the link quality detection packets sent from the FW:
rule permit icmp source destination-address 0 destination source-address 0
If the link quality detection packet and its response packet can match an existing ACL rule on the remote device, the preceding ACL rule does not need to be added.
If no source or destination address is configured for link quality detection packets, the FW will use local-address and remote-address specified in the link command as the source and destination addresses of the packets respectively.
After sending a specific number of link quality detection packets (determined by the packet-number value), the FW will calculate the delay and packet loss rate.
loss-rate: specifies the packet loss rate threshold. The packet loss rate is calculated based on this formula: Packet loss rate = Number of discarded packets within a link quality detection cycle/Total number of link quality detection packets within a link quality detection cycle.
delay: specifies the delay threshold. The delay is calculated based on the formula: Delay = Time when a response packet is received - Time when a detection packet is sent. The FW calculates the delay of each detection packet within a detection cycle and takes an average.
If the packet loss rate or delay over a tunnel exceeds the threshold, a link switchover is triggered.
By default, this function is disabled. After this function is enabled, the FW continuously detects the quality of the high-priority link after the IPSec tunnel is switched to the backup link. If the quality of the high-priority link continuously meets the requirements within the configured switchback delay, the FW automatically switches the IPSec tunnel back to the high-priority link.
After automatic switchback to a high-priority link is enabled, the link quality detection packets in the IPSec intelligent link selection rule on the local device and the ACL rule in the IPSec policy on the peer device are different in the following configurations compared with those before the automatic switchback function is enabled:
For example, if the source IP address of the detection packets on the local device is 1.1.1.1 and the destination IP address is 2.2.2.2, you need to configure the following link quality detection packets on the local device:
link-quality-detection source 1.1.1.1 destination 2.2.2.2
Configure the following ACL rule on the peer device:
rule permit icmp source 2.2.2.2 0 destination 1.1.1.1 0
In addition, the link detection addresses are configured on the local device and the FW does not use the IP addresses of the interfaces at the two ends of the link as the source address and destination address of the detection packets. Therefore, you do not need to configure the ACL rule that uses the IP addresses of the interfaces at the two ends of the IPSec tunnel as the source and destination IP addresses on the peer device.
The default switchback delay is 180 seconds. Automatic switchback is triggered only when the quality (packet loss rate and delay) of the link with a higher priority continuously meets the requirements within the switchback delay.
Run the link-switch-mode route-based command to configure link switchover based on the route status change.
Each IPSec intelligent link selection profile allows a maximum of 3 local addresses and a maximum of 10 peer addresses. Therefore, you can configure a maximum of 30 links (3 x 10 = 30). A link configured earlier is given a higher priority than that of a link configured later. You can use the move link command to adjust the proprieties of links and use the active link command to manually select an IPSec link.
To correctly forward IKE negotiation packets and IPSec packets, ensure that the IPSec gateways are reachable to each other.
After the IPSec link is selected, the FW will apply the IPSec policy that references the IPSec intelligent link selection profile to the interface specified in the link command. In addition, the FW replaces the local address and remote address with those specified in the local-address and remote-address parameters of the link command respectively.
When the local interface obtains IP addresses through DHCP or PPPoE, local-address is obtained from the DHCP or PPPoE server. You do not need to set values for them. If you manually set values for local-address, the FW will use the values that you set.
To correctly forward private network packets from the local end to the peer end, you need to configure the reverse route injection function on the gateway that uses the IPSec intelligent link selection function.
None.
Run the display ipsec smart-link profile command to check configured IPSec intelligent link selection rules.
<sysname> display ipsec smart-link profile name profile1 =========================================== Name :profile1 Detection number :10 Detection interval :1 Detection source IP :1.1.1.1 Detection destination IP :3.3.3.3 Cycles :4 Switched times :4 Switch mode :detection-based State :enable IPSec policy alias :policy1 link list: ID local-address remote-address loss(%) delay(ms) state 1 1.1.1.1 3.3.3.3 2 10 active 2 2.2.2.2 4.4.4.4 0 0 inactive ===========================================