This example describes how to configure virtual systems to establish IPSec VPN tunnels with the peer gateway using the same public IP address in the root system.
As shown in Figure 1, FW_A has only one public IP address and multiple virtual systems use this IP address to establish IPSec VPN tunnels with the peer gateway. IPSec policies are configured in the root system and applied to the WAN interface of the root system. The traffic of virtual systems is protected to implement secure access between the virtual system network and the peer network.
Item |
Data |
|
|---|---|---|
FW_A |
public |
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: virtual interface Virtual-if0 in public Security zone of the LAN interface: Trust |
||
IPSec configuration Local ID type: IP address Local ID: 1.1.1.1 Peer ID type: any Peer ID:
Authentication mode: pre-shared key Key type: multi-key Pre-shared key:
|
||
vsysa |
WAN interface: virtual interface Virtual-if1 in vsysa 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 |
||
vsysb |
WAN interface: virtual interface Virtual-if2 in vsysb 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 |
||
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 |
||
The configuration roadmap is the same in vsysa and vsysb, and on FW_B and FW_C. This section uses vsysa and FW_B as examples to describe how to configure virtual systems to establish IPSec VPN tunnels with the peer gateway using the same public IP address. For configurations of vsysb and FW_C, see those of vsysa and FW_B.
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/2 assign resource-class r1 # vsys name vsysb 2 assign interface GigabitEthernet0/0/3 assign resource-class r1 # ipsec proposal prop28121938566 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 user-table 1 user vsysa id-type any 3.3.3.3 pre-shared-key %^%#V}9n%q.+sR7c'lP8K~+E4k=dT%&\bM,4rj=i%<*%^%# vpn-instance-traffic name vsysa user vsysb id-type any 4.4.4.4 pre-shared-key %^%#V}9n%q.+sR7c'lP8K~+E4k=dT%&\bM,4rj=i%<*%^%# vpn-instance-traffic name vsysb # ike peer ike281219385666 exchange-mode auto ike-proposal 1 local-id 1.1.1.1 user-table 1 # ipsec policy-template tpl281219385666 1 ike-peer ike281219385666 proposal prop28121938566 route inject dynamic alias ipsec_policy_1 sa duration traffic-based 5242880 sa duration time-based 3600 # ipsec policy ipsec2812193856 10000 isakmp template tpl281219385666 # interface GigabitEthernet0/0/1 ip address 1.1.1.1 255.255.255.0 ipsec policy ipsec2812193856 # 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 10.2.0.1 255.255.255.0 # interface Virtual-if0 ip address 172.16.0.1 255.255.255.0 # interface Virtual-if1 ip address 172.16.1.1 255.255.255.0 # interface Virtual-if2 ip address 172.16.2.1 255.255.255.0 # firewall zone trust set priority 85 add interface Virtual-if0 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/1 # security-policy rule name to_internet source-zone trust destination-zone untrust action permit rule name sec_policy_1 source-zone local destination-zone untrust source-address 1.1.1.1 mask 255.255.255.255 action permit rule name sec_policy_2 source-zone untrust destination-zone local 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.1.0.0 255.255.255.0 vpn-instance vsysa ip route-static 10.2.0.0 255.255.255.0 vpn-instance vsysb
The configuration script of vsysa on FW_A:
# switch vsys vsysa # interface GigabitEthernet0/0/2 ip binding vpn-instance vsysa ip address 10.1.0.1 255.255.255.0 # interface Virtual-if1 ip address 172.16.1.1 255.255.255.0 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/2 # firewall zone untrust set priority 5 add interface Virtual-if1 # 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 # return
The configuration script of vsysb on FW_A:
# switch vsys vsysb # interface GigabitEthernet0/0/3 ip binding vpn-instance vsysb ip address 10.2.0.1 255.255.255.0 # interface Virtual-if2 ip address 172.16.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 Virtual-if2 # 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 # 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 prop24121543361 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 ike241215433617 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 ipsec2412154336 1 isakmp security acl 3000 ike-peer ike241215433617 proposal prop24121543361 tunnel local applied-interface alias ipsec_policy_1 sa trigger-mode auto sa duration traffic-based 5242880 sa duration time-based 3600 # interface GigabitEthernet0/0/1 ip address 3.3.3.3 255.255.255.0 ipsec policy ipsec2412154336 # 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 prop24121543361 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 ike241215433617 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 ipsec2412154336 1 isakmp security acl 3000 ike-peer ike241215433617 proposal prop24121543361 tunnel local applied-interface alias ipsec_policy_1 sa trigger-mode auto sa duration traffic-based 5242880 sa duration time-based 3600 # interface GigabitEthernet0/0/1 ip address 4.4.4.4 255.255.255.0 ipsec policy ipsec2412154336 # 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.2.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