As shown in Figure 1, FW_B and FW_C are the gateways of enterprise branches, and FW_A is the gateway of the headquarters. The headquarters and branches communicate through the public network.
The enterprise requires IPSec protection for the traffic between the headquarters and branches. Multiple tunnel interfaces of the headquarters borrow the same physical interface IP address, and one tunnel interface corresponds to one branch.
Configure security policies in ISAKMP mode, including the data flows to be protected and proposal parameters.
Multiple tunnel interfaces of the headquarters borrow the same physical interface IP address to establish an IPSec tunnel with a branch. Therefore, the headquarters uses the peer IP address of the IKE peer to identify the tunnel interface connected to the branch. In this instance, multiple IKE peers need to be configured and multiple IPSec policies created at the headquarters. In addition, different IPSec policies are applied to the tunnel interfaces.
When multiple branches connect to the headquarters, multiple tunnel interfaces in the headquarters borrow the same physical interface IP address. In this scenario, the headquarters can identify the tunnel interface connected to a branch through the peer IP address or peer ID of the IKE peer (Only IKEv1 in aggressive mode supports the peer ID mode.).
To use the ping command for link detection, run the service-manage ping permit command in the interface view to set the ping service of all firewall interfaces on the link to permit.
# Run the ping -a source-ip-address host command to ping the private network addresses. If the headquarters and branches can ping each other, services between them are reachable. The following uses FW_A as an example:
[FW_A] ping -a 10.1.1.1 10.1.2.2
PING 10.1.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.2.2: bytes=56 Sequence=1 ttl=255 time=89 ms
Reply from 10.1.2.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 10.1.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/18/89 ms
[FW_A] ping -a 10.1.1.1 10.1.3.2
PING 10.1.3.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.3.2: bytes=56 Sequence=1 ttl=255 time=89 ms
Reply from 10.1.3.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 10.1.3.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 10.1.3.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 10.1.3.2: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 10.1.3.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/18/89 ms
# Run the display ike sa command. If information about the IKE SA and IPSec SA is displayed, the IPSec tunnel is established successfully. The following uses FW_A as an example:
[FW_A] display ike sa
IKE SA information :
Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID
------------------------------------------------------------------------------
50336907 1.1.5.1:500 RD|ST|A v2:2 IP 1.1.5.1
50336906 1.1.5.1:500 RD|ST|A v2:1 IP 1.1.5.1
33554436 1.1.6.1:500 RD|ST|A v2:2 IP 1.1.6.1
33554435 1.1.6.1:500 RD|ST|A v2:1 IP 1.1.6.1
Number of IKE SA : 4
------------------------------------------------------------------------------
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 # acl number 3000 rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 acl number 3001 rule 10 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.3.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 b pre-shared-key %^%#W)04NhZ:bP=~"=KQu\CN6KcK#NE5:(Os2L57]r5I%^%# ike-proposal 10 remote-address 1.1.5.1 ike peer c pre-shared-key %^%#W)04NhZ:bP=~"=KQu\CN6KcK#NE5:(Os2L57]r5I%^%# ike-proposal 10 remote-address 1.1.6.1 # ipsec policy map1 10 isakmp security acl 3000 ike-peer b proposal tran1 ipsec policy map2 10 isakmp security acl 3001 ike-peer c proposal tran1 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.3.1 255.255.255.0 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface Tunnel0 ip address unnumbered interface GigabitEthernet0/0/1 tunnel-protocol ipsec ipsec policy map1 # interface Tunnel1 ip address unnumbered interface GigabitEthernet0/0/1 tunnel-protocol ipsec ipsec policy map2 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 add interface Tunnel0 add interface Tunnel1 # ip route-static 0.0.0.0 0.0.0.0 1.1.3.2 ip route-static 10.1.2.0 255.255.255.0 Tunnel0 ip route-static 10.1.3.0 255.255.255.0 Tunnel1 # 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 destination-address 10.1.3.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 source-address 10.1.3.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 action permit rule name policy4 source-zone untrust destination-zone local destination-address 1.1.3.1 mask 255.255.255.255 action permit # return
FW_B 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 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)04NhZ:bP=~"=KQu\CN6KcK#NE5:(Os2L57]r5I%^%# ike-proposal 10 remote-address 1.1.3.1 # 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 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.2.1 255.255.255.0 # interface Tunnel0 ip address unnumbered interface GigabitEthernet0/0/1 tunnel-protocol ipsec ipsec policy map1 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 add interface Tunnel0 # ip route-static 0.0.0.0 0.0.0.0 1.1.5.2 ip route-static 10.1.1.0 255.255.255.0 Tunnel0 # 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 action permit rule name policy4 source-zone untrust destination-zone local destination-address 1.1.5.1 mask 255.255.255.255 action permit # return
Configuration file of FW_C
# sysname FW_C # acl number 3000 rule 5 permit ip source 10.1.3.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)04NhZ:bP=~"=KQu\CN6KcK#NE5:(Os2L57]r5I%^%# ike-proposal 10 remote-address 1.1.3.1 # ipsec policy map1 10 isakmp security acl 3000 ike-peer a proposal tran1 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.6.1 255.255.255.0 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.3.1 255.255.255.0 # interface Tunnel1 ip address unnumbered interface GigabitEthernet0/0/1 tunnel-protocol ipsec ipsec policy map1 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 add interface Tunnel1 # ip route-static 0.0.0.0 0.0.0.0 1.1.6.2 ip route-static 10.1.1.0 255.255.255.0 Tunnel1 # security-policy rule name policy1 source-zone trust destination-zone untrust source-address 10.1.3.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.3.0 mask 255.255.255.0 action permit rule name policy3 source-zone local destination-zone untrust source-address 1.1.6.1 mask 255.255.255.255 action permit rule name policy4 source-zone untrust destination-zone local destination-address 1.1.6.1 mask 255.255.255.255 action permit # return