As shown in Figure 1, FW_A connects the headquarters to the Internet, and FW_B connects the branch to the Internet. FW_A and FW_B establish an IPSec tunnel in between. To prevent the IPSec service on FW_A from being affected by other services on the firewall, it is required that a VPN instance be created on FW_A and an IPSec tunnel be configured in this VPN instance to isolate the IPSec service.
Item |
FW_A |
FW_B |
|
|---|---|---|---|
Interface |
GigabitEthernet 0/0/1 IP address: 10.1.1.1/24 VPN instance: vpn1 Security zone: Trust GigabitEthernet 0/0/2 IP address: 1.1.3.1/24 VPN instance: vpn1 Security zone: Untrust |
GigabitEthernet 0/0/1 IP address: 10.1.2.1/24 Security zone: Trust GigabitEthernet 0/0/2 IP address: 1.1.5.1/24 Security zone: Untrust |
|
IPSec policy type |
Non-template |
Non-template |
|
IPSec proposal |
Encapsulation mode |
Tunnel mode |
Tunnel mode |
Security protocol |
ESP |
ESP |
|
ESP authentication algorithm |
SHA2-256 |
SHA2-256 |
|
ESP encryption algorithm |
AES-256 |
AES-256 |
|
IKE peer |
Negotiation mode |
Main mode |
Main mode |
Pre-shared key |
Key123 |
Key123 |
|
Identity type |
IP address |
IP address |
|
Version |
IKEv1 and IKEv2 |
IKEv1 and IKEv2 |
|
The configuration roadmap is as follows:
When you configure IKE peers, you need to specify the mapping between the IPSec tunnel and VPN instance. For details, see 1.e.iv for configuring FW_A.
<FW_A> display ike sa
IKE SA information :
Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID
-----------------------------------------------------------------------------
10 1.1.5.1:500 vpn1 RD|ST|A V2:2 IP 1.1.5.1
9 1.1.5.1:500 vpn1 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> display ipsec sa brief
Current ipsec sa num:2
Spu board slot 1, cpu 0 ipsec sa information:
Number of SAs:4
Src address Dst address SPI VPN Protocol Algorithm
-------------------------------------------------------------------------------
1.1.5.1 1.1.3.1 4001819557 vpn1 ESP E:AES-256 A:SHA2-256-128
1.1.3.1 1.1.5.1 3923280450 vpn1 ESP E:AES-256 A:SHA2-256-128
FW_A (headquarters) configuration file
# sysname FW_A # ip vpn-instance vpn1 route-distinguisher 100:1 # acl number 3000 vpn-instance vpn1 rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 1 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 %^%#cnEDZkL3}#J"qG/2iTb&P9q/%^%# ike-proposal 1 remote-address vpn-instance vpn1 1.1.5.1 sa binding vpn-instance vpn1 # ipsec policy map1 1 isakmp security acl 3000 ike-peer b proposal tran1 # interface GigabitEthernet0/0/1 undo shutdown ip binding vpn-instance vpn1 ip address 10.1.1.1 24 # interface GigabitEthernet0/0/2 undo shutdown ip binding vpn-instance vpn1 ip address 1.1.3.1 255.255.255.0 ipsec policy map1 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 # ip route-static vpn-instance vpn1 1.1.5.0 255.255.255.0 1.1.3.2 ip route-static vpn-instance vpn1 10.1.2.0 255.255.255.0 1.1.3.2 # security-policy rule name 1 source-zone untrust destination-zone trust source-address 10.1.2.0 24 destination-address 10.1.1.0 24 action permit rule name 2 source-zone trust destination-zone untrust source-address 10.1.1.0 24 destination-address 10.1.2.0 24 action permit rule name 3 source-zone local destination-zone untrust source-address 1.1.3.1 32 destination-address 1.1.5.1 32 action permit rule name 4 source-zone untrust destination-zone local source-address 1.1.5.1 32 destination-address 1.1.3.1 32 action permit # return
FW_B (branch) configuration file
# sysname FW_B # 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 1 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 %^%#1tx/S9a;iF[L)QFz!$p;y]Lg%^%# ike-proposal 1 remote-address 1.1.3.1 # ipsec policy map1 1 isakmp security acl 3000 ike-peer a proposal tran1 # interface GigabitEthernet0/0/1 undo shutdown ip address 10.1.2.1 24 interface GigabitEthernet0/0/2 undo shutdown ip address 1.1.5.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 # ip route-static 10.1.1.0 255.255.255.0 1.1.5.2 ip route-static 1.1.3.0 255.255.255.0 1.1.5.2 # security-policy rule name 1 source-zone untrust destination-zone trust source-address 10.1.1.0 24 destination-address 10.1.2.0 24 action permit rule name 2 source-zone trust destination-zone untrust source-address 10.1.2.0 24 destination-address 10.1.1.0 24 action permit rule name 3 source-zone local destination-zone untrust source-address 1.1.5.1 32 destination-address 1.1.3.1 32 action permit rule name 4 source-zone untrust destination-zone local source-address 1.1.3.1 32 destination-address 1.1.5.1 32 action permit # return