This example describes how to configure virtual systems to establish IPSec VPN tunnels with the peer gateway using independent public IP addresses.
As shown in Figure 1, multiple WAN interfaces are configured on FW_A and each WAN interface has an independent public IP address. Assign the WAN interfaces to different virtual systems, configure IPSec policies for the virtual systems, and apply the IPSec policies to the WAN interfaces to make the virtual systems establish IPSec VPN tunnels with the peer gateway using independent public IP addresses. As a result, the virtual systems can communicate with the peer network securely.
Item |
Data |
|
|---|---|---|
FW_A |
vsysa |
WAN interface: GE0/0/1 IP address of the WAN interface: 1.1.1.1/24 Security zone of the WAN interface: Untrust |
LAN interface: GE0/0/2 IP address of the LAN interface: 10.1.0.1/24 IP address range of the LAN interface: 10.1.0.0/24 Security zone of the LAN interface: Trust |
||
| IPSec configuration Peer IP address: 3.3.3.3/24 Authentication mode: pre-shared key Pre-shared key: Admin@123 Local ID: IP address Peer ID: any |
||
vsysb |
WAN interface: GE0/0/3 IP address of the WAN interface: 2.2.2.2/24 Security zone of the WAN interface: Untrust |
|
LAN interface: GE0/0/4 IP address of the LAN interface: 10.2.0.1/24 IP address range of the LAN interface: 10.2.0.0/24 Security zone of the LAN interface: Trust |
||
| IPSec configuration Peer IP address: 4.4.4.4/24 Authentication mode: pre-shared key Pre-shared key: Admin@123 Local ID: IP address Peer ID: any |
||
FW_B |
Interface: GE0/0/1 IP address: 3.3.3.3/24 Security zone of the interface: Untrust |
|
Interface: GE0/0/2 IP address: 10.3.0.1/24 IP address range of the LAN interface: 10.3.0.0/24 Security zone of the interface: Trust |
||
| IPSec configuration Peer IP address: 1.1.1.1/24 Authentication mode: pre-shared key Pre-shared key: Admin@123 Local ID: IP address Peer ID: any |
||
FW_C |
Interface: GE0/0/1 IP address: 4.4.4.4/24 Security zone of the interface: Untrust |
|
Interface: GE0/0/2 IP address: 10.4.0.1/24 IP address range of the LAN interface: 10.4.0.0/24 Security zone of the interface: Trust |
||
| IPSec configuration Peer IP address: 2.2.2.2/24 Authentication mode: pre-shared key Pre-shared key: Admin@123 Local ID: IP address Peer ID: any |
||
After the configuration is complete, run the ping command on the PC in network A to trigger IKE negotiation.
If the IKE negotiation succeeds, a tunnel is established and the PC in network C can be pinged. If the IKE negotiation fails, no tunnel is established and the PC in network C cannot be pinged.
On FW_A and FW_B, run the display ike sa and display ipsec sa commands to check whether the SAs are established. Take FW_B as an example. If the following information is displayed, the IKE and IPSec SAs are successfully established.
<FW_B> display ike sa
Ike sa information :
Conn-ID Peer VPN Flag(s) Phase
------------------------------------------------------------------------------
16777239 1.1.1.1 RD|ST|A v2:2
16777232 1.1.1.1 RD|ST|A v2:1
Number of SA entries : 2
Number of SA entries of all cpu : 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_B> display ipsec sa ipsec sa information: =============================== Interface: GigabitEthernet0/0/1 =============================== ----------------------------- IPSec policy name: "ipsec1" Sequence number : 1 Acl group : 3000 Acl rule : 5 Mode : ISAKMP ----------------------------- Connection ID : 83903371 Encapsulation mode: Tunnel Tunnel local : 3.3.3.3 Tunnel remote : 1.1.1.1 Flow source : 10.3.0.1/255.255.255.255 0/0 Flow destination : 10.1.0.1/255.255.255.255 0/0 [Outbound ESP SAs] SPI: 763065754 (0x2d7b759a) Proposal: ESP-ENCRYPT-AES-256 SHA2-256-128 SA remaining key duration (kilobytes/sec): 0/3079 Max sent sequence-number: 1 UDP encapsulation used for NAT traversal: N SA encrypted packets (number/kilobytes): 4/0 [Inbound ESP SAs] SPI: 163241969 (0x9badff1) Proposal: ESP-ENCRYPT-AES-256 SHA2-256-128 SA remaining key duration (kilobytes/sec): 0/3079 Max received sequence-number: 3203668 UDP encapsulation used for NAT traversal: N SA decrypted packets (number/kilobytes): 4/0 Anti-replay : Disable
The configuration script of the root system on FW_A:
# sysname FW_A # vsys enable # resource-class r1 resource-item-limit ipsec-tunnel reserved-number 10 maximum 500 # vsys name vsysa 1 assign interface GigabitEthernet0/0/1 assign interface GigabitEthernet0/0/2 assign resource-class r1 # vsys name vsysb 2 assign interface GigabitEthernet0/0/3 assign interface GigabitEthernet0/0/4 assign resource-class r1 # interface GigabitEthernet0/0/1 ip binding vpn-instance vsysa ip address 1.1.1.1 255.255.255.0 ipsec policy ipsec1 # interface GigabitEthernet0/0/2 ip binding vpn-instance vsysa ip address 10.1.0.1 255.255.255.0 # interface GigabitEthernet0/0/3 ip binding vpn-instance vsysb ip address 2.2.2.2 255.255.255.0 ipsec policy ipsec2 # interface GigabitEthernet0/0/4 ip binding vpn-instance vsysb ip address 10.2.0.1 255.255.255.0
The configuration script of vsysa on FW_A:
#
switch vsys vsysa
#
acl number 3000
rule 5 permit ip source 10.1.0.0 0.0.0.255 destination 10.3.0.0 0.0.0.255
#
ipsec proposal tran1
encapsulation-mode auto
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256
#
ike proposal 1
encryption-algorithm aes-256
dh group2
authentication-algorithm sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256
#
ike peer a
exchange-mode auto
pre-shared-key %^%#m`wdHMo4eVMY2&*+hDV~BbN&<=zoQ@d{n%=**qR6%^%#
ike-proposal 1
remote-id-type ip
remote-id 3.3.3.3
local-id 1.1.1.1
remote-address 3.3.3.3
#
ipsec policy ipsec1 1 isakmp
security acl 3000
ike-peer a
proposal tran1
#
interface GigabitEthernet0/0/1
ip binding vpn-instance vsysa
ip address 1.1.1.1 255.255.255.0
ipsec policy ipsec1
#
interface GigabitEthernet0/0/2
ip binding vpn-instance vsysa
ip address 10.1.0.1 255.255.255.0
#
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/2
#
firewall zone untrust
set priority 5
add interface GigabitEthernet0/0/1
#
security-policy
rule name sec_policy_1
source-zone trust
destination-zone untrust
source-address 10.1.0.0 mask 255.255.255.0
destination-address 10.3.0.0 mask 255.255.255.0
action permit
rule name sec_policy_2
source-zone untrust
destination-zone trust
source-address 10.3.0.0 mask 255.255.255.0
destination-address 10.1.0.0 mask 255.255.255.0
action permit
rule name sec_policy_3
source-zone local
destination-zone untrust
source-address 1.1.1.1 mask 255.255.255.255
destination-address 3.3.3.3 mask 255.255.255.255
action permit
rule name sec_policy_4
source-zone untrust
destination-zone local
source-address 3.3.3.3 mask 255.255.255.255
destination-address 1.1.1.1 mask 255.255.255.255
action permit
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2
ip route-static 10.3.0.0 255.255.255.0 1.1.1.2
#
return
The configuration script of vsysb on FW_A:
#
switch vsys vsysb
#
acl number 3001
rule 5 permit ip source 10.2.0.0 0.0.0.255 destination 10.4.0.0 0.0.0.255
#
ipsec proposal tran2
encapsulation-mode auto
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256
#
ike proposal 2
encryption-algorithm aes-256
dh group2
authentication-algorithm sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256
#
ike peer b
exchange-mode auto
pre-shared-key %^%#m`wdHMo4eVMY2&*+hDV~BbN&<=zoQ@d{n%=**qR6%^%#
ike-proposal 2
remote-id-type ip
remote-id 4.4.4.4
local-id 2.2.2.2
remote-address 4.4.4.4
#
ipsec policy ipsec2 1 isakmp
security acl 3001
ike-peer b
proposal tran2
#
interface GigabitEthernet0/0/3
ip binding vpn-instance vsysb
ip address 2.2.2.2 255.255.255.0
ipsec policy ipsec2
#
interface GigabitEthernet0/0/4
ip binding vpn-instance vsysb
ip address 10.2.0.1 255.255.255.0
#
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/4
#
firewall zone untrust
set priority 5
add interface GigabitEthernet0/0/3
#
security-policy
rule name sec_policy_1
source-zone trust
destination-zone untrust
source-address 10.2.0.0 mask 255.255.255.0
destination-address 10.4.0.0 mask 255.255.255.0
action permit
rule name sec_policy_2
source-zone untrust
destination-zone trust
source-address 10.4.0.0 mask 255.255.255.0
destination-address 10.2.0.0 mask 255.255.255.0
action permit
rule name sec_policy_3
source-zone local
destination-zone untrust
source-address 2.2.2.2 mask 255.255.255.255
destination-address 4.4.4.4 mask 255.255.255.255
action permit
rule name sec_policy_4
source-zone untrust
destination-zone local
source-address 4.4.4.4 mask 255.255.255.255
destination-address 2.2.2.2 mask 255.255.255.255
action permit
#
ip route-static 0.0.0.0 0.0.0.0 2.2.2.3
ip route-static 10.4.0.0 255.255.255.0 2.2.2.3
#
return
The configuration script on FW_B:
# sysname FW_B # acl number 3000 rule 5 permit ip source 10.3.0.0 0.0.0.255 destination 10.1.0.0 0.0.0.255 # ipsec proposal tran1 encapsulation-mode auto esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 1 encryption-algorithm aes-256 dh group2 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer a exchange-mode auto pre-shared-key %^%#@ama1^ws3/PX+B.f~tnNDy(q~gjoR%dmP6.\U#5~%^%# ike-proposal 1 remote-id-type ip remote-id 1.1.1.1 local-id 3.3.3.3 remote-address 1.1.1.1 # ipsec policy ipsec1 1 isakmp security acl 3000 ike-peer a proposal tran1 # interface GigabitEthernet0/0/1 ip address 3.3.3.3 255.255.255.0 ipsec policy ipsec1 # interface GigabitEthernet0/0/2 ip address 10.3.0.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/2 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 # ip route-static 0.0.0.0 0.0.0.0 3.3.3.4 ip route-static 10.1.0.0 255.255.255.0 3.3.3.4 # security-policy rule name sec_policy_1 source-zone trust destination-zone untrust source-address 10.3.0.0 mask 255.255.255.0 destination-address 10.1.0.0 mask 255.255.255.0 action permit rule name sec_policy_2 source-zone untrust destination-zone trust source-address 10.1.0.0 mask 255.255.255.0 destination-address 10.3.0.0 mask 255.255.255.0 action permit rule name sec_policy_3 source-zone local destination-zone untrust source-address 3.3.3.3 mask 255.255.255.255 destination-address 1.1.1.1 mask 255.255.255.255 action permit rule name sec_policy_4 source-zone untrust destination-zone local source-address 1.1.1.1 mask 255.255.255.255 destination-address 3.3.3.3 mask 255.255.255.255 action permit
The configuration script on FW_C:
# sysname FW_C # acl number 3000 rule 5 permit ip source 10.4.0.0 0.0.0.255 destination 10.2.0.0 0.0.0.255 # ipsec proposal tran1 encapsulation-mode auto esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 1 encryption-algorithm aes-256 dh group2 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer a exchange-mode auto pre-shared-key %^%#@ama1^ws3/PX+B.f~tnNDy(q~gjoR%dmP6.\U#5~%^%# ike-proposal 1 remote-id-type ip remote-id 2.2.2.2 local-id 4.4.4.4 remote-address 2.2.2.2 # ipsec policy ipsec1 1 isakmp security acl 3000 ike-peer a proposal tran1 # interface GigabitEthernet0/0/1 ip address 4.4.4.4 255.255.255.0 ipsec policy ipsec1 # interface GigabitEthernet0/0/2 ip address 10.4.0.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/2 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 # ip route-static 0.0.0.0 0.0.0.0 4.4.4.5 ip route-static 10.1.0.0 255.255.255.0 4.4.4.5 # security-policy rule name sec_policy_1 source-zone trust destination-zone untrust source-address 10.4.0.0 mask 255.255.255.0 destination-address 10.2.0.0 mask 255.255.255.0 action permit rule name sec_policy_2 source-zone untrust destination-zone trust source-address 10.2.0.0 mask 255.255.255.0 destination-address 10.4.0.0 mask 255.255.255.0 action permit rule name sec_policy_3 source-zone local destination-zone untrust source-address 4.4.4.4 mask 255.255.255.255 destination-address 2.2.2.2 mask 255.255.255.255 action permit rule name sec_policy_4 source-zone untrust destination-zone local source-address 2.2.2.2 mask 255.255.255.255 destination-address 4.4.4.4 mask 255.255.255.255 action permit