In Figure 1, the branch communicates with the headquarters over the Internet. To improve reliability, the headquarters uses link redundancy: The active link is the link for GigabitEthernet 0/0/1, and the standby link is the link for GigabitEthernet 0/0/2. If the active link fails, traffic is switched to the standby link.
The networking must meet the following requirements: Establish an IKE IPSec tunnel between FW_A and FW_B so that users on networks A and B can communicate with each other through the IPSec tunnel.
The enterprise requires that IPSec secure traffic transmitted between the branch and headquarters to prevent IPSec traffic interruptions during an active/standby link switchover. In addition, the enterprise wants decrypted packets to be checked. That is, if the packets should not be encrypted but have been encrypted, the packets are discarded.
The configuration roadmap is as follows:
Configure IPSec policies, including data flows to be encrypted and IPSec proposal negotiation parameters.
Configure the post-IPSec check function to check decrypted packets. If the packets should not be encrypted but have been encrypted, the packets are discarded. In addition, the system checks whether the interface that receives encrypted traffic is the interface that establishes an IPSec SA. If the two interfaces are different, the system discards the encrypted traffic.
However, if a link switchover occurs at the headquarters, and the interface that receives encrypted traffic is not the interface that establishes an IPSec SA, the headquarters discards the encrypted traffic. Therefore, both DPD detection and the function that checks whether the interface that receives encrypted traffic is the interface that establishes an IPSec SA must be configured at the headquarters. If the two interfaces are different, DPD packets are discarded and DPD detection becomes abnormal. This causes the IPSec SA to be deleted and triggers IKE re-negotiation.
After the preceding configurations are complete, run the ping command on PC1 to trigger IKE negotiation.
If IKE negotiation is successful, an IPSec tunnel can be established and PC1 can ping PC2 successfully. If IKE negotiation fails, no IPSec tunnel can be established and PC1 cannot ping PC2.
Run the display ike sa command to view SA establishment information. The following example is the command output of FW_A. Command output similar to the following indicates that an IKE SA and an IPSec SA have been established.
<FW_A> display ike sa
IKE SA information :
Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID
-----------------------------------------------------------------------------
16777239 1.1.5.1:500 RD|ST|A v2:2 IP 1.1.5.1
16777232 1.1.5.1:500 RD|ST|A v2:1 IP 1.1.5.1
Number of IKE SA : 2
-------------------------------------------------------------------------------
Flag Description:
RD--READY ST--STAYALIVE RL--REPLACED FD--FADING TO--TIMEOUT
HRT--HEARTBEAT LKG--LAST KNOWN GOOD SEQ NO. BCK--BACKED UP
M--ACTIVE S--STANDBY A--ALONE NEG--NEGOTIATING
FW_A configuration file
# sysname FW_A # ike dpd type periodic ike dpd packet receive if-related enable ike dpd msg seq-notify-hash # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 10 encryption-algorithm aes-256 dh group14 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer b pre-shared-key %@%@'OMi3SPl%@TJdx5uDE(44*I^%@%@ ike-proposal 10 # ipsec policy-template use1 10 ike-peer b proposal tran1 # ipsec policy map1 10 isakmp template use1 ipsec policy map2 10 isakmp template use1 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.3.1 255.255.255.0 ipsec policy map1 # interface GigabitEthernet0/0/2 undo shutdown ip address 1.1.4.1 255.255.255.0 ipsec policy map2 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface LoopBack0 ip address 2.2.2.2 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 add interface GigabitEthernet0/0/2 # ip route-static 1.1.5.0 255.255.255.0 1.1.3.2 preference 40 ip route-static 1.1.5.0 255.255.255.0 1.1.4.2 preference 80 ip route-static 10.1.2.0 255.255.255.0 1.1.3.2 preference 40 ip route-static 10.1.2.0 255.255.255.0 1.1.4.2 preference 80 # security-policy rule name policy1 source-zone trust destination-zone untrust source-address 10.1.1.0 mask 255.255.255.0 destination-address 10.1.2.0 mask 255.255.255.0 action permit rule name policy2 source-zone untrust destination-zone trust source-address 10.1.2.0 mask 255.255.255.0 destination-address 10.1.1.0 mask 255.255.255.0 action permit rule name policy3 source-zone local destination-zone untrust source-address 1.1.3.1 mask 255.255.255.255 source-address 1.1.4.1 mask 255.255.255.255 destination-address 1.1.5.1 mask 255.255.255.255 action permit rule name policy4 source-zone untrust destination-zone local source-address 1.1.5.1 mask 255.255.255.255 destination-address 1.1.3.1 mask 255.255.255.255 destination-address 1.1.4.1 mask 255.255.255.255 action permit # return
FW_B configuration file
# sysname FW_B # ike dpd type periodic ike dpd msg seq-notify-hash # acl number 3000 rule 5 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 10 encryption-algorithm aes-256 dh group14 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer a pre-shared-key %@%@W[QD:1tV\'f"!1W&yrX6v$B>%@%@ ike-proposal 10 remote-address 2.2.2.2 # ipsec policy map1 10 isakmp security acl 3000 ike-peer a proposal tran1 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.5.1 255.255.255.0 ipsec policy map1 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.2.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 # ip route-static 0.0.0.0.0 0.0.0.0 1.1.5.2 # security-policy rule name policy1 source-zone trust destination-zone untrust source-address 10.1.2.0 mask 255.255.255.0 destination-address 10.1.1.0 mask 255.255.255.0 action permit rule name policy2 source-zone untrust destination-zone trust source-address 10.1.1.0 mask 255.255.255.0 destination-address 10.1.2.0 mask 255.255.255.0 action permit rule name policy3 source-zone local destination-zone untrust source-address 1.1.5.1 mask 255.255.255.255 destination-address 1.1.3.1 mask 255.255.255.255 destination-address 1.1.4.1 mask 255.255.255.255 action permit rule name policy4 source-zone untrust destination-zone local source-address 1.1.3.1 mask 255.255.255.255 source-address 1.1.4.1 mask 255.255.255.255 destination-address 1.1.5.1 mask 255.255.255.255 action permit # return