As shown in Figure 1, FW_A connects network A to the Internet and FW_B connects network B to the Internet. The networking requirements are as follows:
Network A (10.1.1.0/24) is connected to GigabitEthernet 0/0/3 of FW_A.
Network B (10.1.2.0/24) is connected to GigabitEthernet 0/0/3 of FW_B.
The purpose of this networking is to set up an IPSec tunnel between FW_A and FW_B to enable communication between users on network A and network B.
Item |
Data |
|---|---|
FW_A |
Interface number: GigabitEthernet 0/0/3 IP address: 10.1.1.1/24 Security zone: Trust |
Interface number: GigabitEthernet 0/0/1 IP address: 1.1.3.1/24 Security zone: Untrust |
|
IPSec configuration Peer IP address: 1.1.5.1 Authentication type: pre-shared key Pre-shared key: Test!1234 Local ID type: IP address Peer ID type: IP address |
|
FW_B |
Interface number: GigabitEthernet 0/0/1 IP address: 1.1.5.1/24 Security zone: Untrust |
Interface number: GigabitEthernet 0/0/3 IP address: 10.1.2.1/24 Security zone: Trust |
|
IPSec configuration Peer IP address: 1.1.3.1 Authentication type: pre-shared key Pre-shared key: Test!1234 Local ID type: IP address Peer ID type: IP address |
The roadmap for configuring FW_A is similar to that for configuring FW_B:
After the configuration is complete, run the ping command on PC1 to trigger IKE negotiation.
If the IKE negotiation is successful, a tunnel is established and PC2 can be pinged from PC1. If the IKE negotiation fails, no tunnel is established and PC2 cannot be pinged from PC1.
Run the display ike sa and display ipsec sa commands on both FW_A and FW_B to check SA establishment.
Take FW_B for example. If the following information is displayed, the IKE SA and IPSec SA are successfully established.
<FW_B> display ike sa
IKE SA information :
Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID
-----------------------------------------------------------------------------
16777239 1.1.3.1:500 RD|ST|A v2:2 IP 1.1.3.1
16777232 1.1.3.1:500 RD|ST|A v2:1 IP 1.1.3.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_B> display ipsec sa ipsec sa information: =============================== Interface: GigabitEthernet0/0/1 =============================== ----------------------------- IPSec policy name: "map1" Sequence number : 10 Acl group : 3000 Acl rule : 5 Mode : ISAKMP ----------------------------- Connection ID : 83903371 Encapsulation mode: Tunnel Tunnel local : 1.1.5.1 Tunnel remote : 1.1.3.1 Flow source : 10.1.2.2/255.255.255.255 0/0 Flow destination : 10.1.1.2/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 : Enable Anti-replay window size: 1024
# 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 # 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 remote-address 1.1.5.1 # ipsec policy map1 10 isakmp security acl 3000 ike-peer b proposal tran1 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.3.1 255.255.255.0 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 # ip route-static 1.1.5.0 255.255.255.0 1.1.3.2 ip route-static 10.1.2.0 255.255.255.0 1.1.3.2 # 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 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 action permit # return
# 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[QD:1tV\'f"!1W&yrX6v$B>%@%@ 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/3 undo shutdown ip address 10.1.2.1 255.255.255.0 # interface GigabitEthernet0/0/1 undo shutdown ip address 1.1.5.1 255.255.255.0 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 # ip route-static 1.1.3.0 255.255.255.0 1.1.5.2 ip route-static 10.1.1.0 255.255.255.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 action permit rule name policy4 source-zone untrust destination-zone local source-address 1.1.3.1 mask 255.255.255.255 destination-address 1.1.5.1 mask 255.255.255.255 action permit # return