赞
踩
素材来源:华为防火墙配置指南
一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_华为模拟器实验
目标
介绍设备以二层透明方式接入网络时,IPSec隧道的配置方法。
组网需求
如图1所示,分支机构和总部分别通过FW_A和FW_B连接到Internet。FW_C是以二层透明方式部署在FW_B和L3SW(三层交换机)之间。用户需要在FW_A和FW_C之间建立IPSec隧道,以保护分支与总部之间进行安全通信。
配置思路
操作步骤
配置FW_A。
按照图1配置接口IP地址。
- <sysname> system-view
- [sysname] sysname FW_A
- [FW_A] interface gigabitethernet 1 / 0 / 1
- [FW_A-GigabitEthernet1/0/1] ip address 10.1.1.1 24
- [FW_A-GigabitEthernet1/0/1] quit
- [FW_A] interface gigabitethernet 1 / 0 / 2
- [FW_A-GigabitEthernet1/0/2] ip address 1.1.1.1 24
- [FW_A-GigabitEthernet1/0/2] quit
- 复制代码
- [FW_A] firewall zone untrust
- [FW_A-zone-untrust] add interface gigabitethernet 1 / 0 / 2
- [FW_A-zone-untrust] quit
- [FW_A] firewall zone trust
- [FW_A-zone-trust] add interface gigabitethernet 1 / 0 / 1
- [FW_A-zone-trust] quit
- 复制代码
配置安全策略。
- [FW_A] security-policy
- [FW_A-policy-security] rule name 1
- [FW_A-policy-security-rule-1] source-zone trust
- [FW_A-policy-security-rule-1] destination-zone untrust
- [FW_A-policy-security-rule-1] source-address 10.1.1.0 24
- [FW_A-policy-security-rule-1] destination-address 10.4.1.0 24
- [FW_A-policy-security-rule-1] action permit
- [FW_A-policy-security-rule-1] quit
- [FW_A-policy-security] rule name 2
- [FW_A-policy-security-rule-2] source-zone untrust
- [FW_A-policy-security-rule-2] destination-zone trust
- [FW_A-policy-security-rule-2] source-address 10.4.1.0 24
- [FW_A-policy-security-rule-2] destination-address 10.1.1.0 24
- [FW_A-policy-security-rule-2] action permit
- [FW_A-policy-security-rule-2] quit
- 复制代码
- [FW_A-policy-security] rule name 3
- [FW_A-policy-security-rule-3] source-zone local
- [FW_A-policy-security-rule-3] destination-zone untrust
- [FW_A-policy-security-rule-3] source-address 1.1.1.0 24
- [FW_A-policy-security-rule-3] destination-address 3.1.1.0 24
- [FW_A-policy-security-rule-3] action permit
- [FW_A-policy-security-rule-3] quit
- [FW_A-policy-security] rule name 4
- [FW_A-policy-security-rule-4] source-zone untrust
- [FW_A-policy-security-rule-4] destination-zone local
- [FW_A-policy-security-rule-4] source-address 3.1.1.0 24
- [FW_A-policy-security-rule-4] destination-address 1.1.1.0 24
- [FW_A-policy-security-rule-4] action permit
- [FW_A-policy-security-rule-4] quit
- [FW_A-policy-security] quit
- 复制代码
配置IPSec。
- [FW_A] acl 3001
- [FW_A-acl-adv-3001] rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.4.1.0 0.0.0.255
- [FW_A-acl-adv-3001] quit
- 复制代码
- [FW_A] ipsec proposal tran1
- [FW_A-ipsec-proposal-tran1] encapsulation-mode tunnel
- [FW_A-ipsec-proposal-tran1] transform esp
- [FW_A-ipsec-proposal-tran1] esp authentication-algorithm sha2- 256
- [FW_A-ipsec-proposal-tran1] esp encryption-algorithm aes- 256
- [FW_A-ipsec-proposal-tran1] quit
- 复制代码
- [FW_A] ike proposal 1
- [FW_A-ike-proposal-1] authentication-method pre-share
- [FW_A-ike-proposal-1] authentication-algorithm sha2- 256
- [FW_A-ike-proposal-1] quit
- 复制代码
- [FW_A] ike peer peer1
- [FW_A-ike-peer-peer1] undo version 2
- [FW_A-ike-peer-peer1] ike-proposal 1
- [FW_A-ike-peer-peer1] remote-address 3.1.1.1
- [FW_A-ike-peer-peer1] remote-address authentication-address 10.2.1.3
- [FW_A-ike-peer-peer1] pre-shared-key Admin @ 123
- [FW_A-ike-peer-peer1] quit
- 复制代码
- [FW_A] ipsec policy map1 10 isakmp
- [FW_A-ipsec-policy-isakmp-map1-10] security acl 3001
- [FW_A-ipsec-policy-isakmp-map1-10] proposal tran1
- [FW_A-ipsec-policy-isakmp-map1-10] ike-peer peer1
- [FW_A-ipsec-policy-isakmp-map1-10] quit
- 复制代码
- [FW_A] interface gigabitethernet 1 / 0 / 2
- [FW_A-GigabitEthernet1/0/2] ipsec policy map1
- [FW_A-GigabitEthernet1/0/2] quit
- 复制代码
- [FW_A] ip route- static 10.4.1.0 255.255.255.0 1.1.1.2
- 复制代码
配置FW_B。
- [FW_B] ip route- static 1.1.1.0 255.255.255.0 2.2.2.1
- 复制代码
- [FW_B] nat server nats global 3.1.1.1 inside 10.2.1.3
- 复制代码
配置FW_C。
完成VLAN及VLANIF的相关配置。
- [FW_C] vlan 1
- [FW_C-vlan1] quit
- 复制代码
- [FW_C] interface gigabitethernet 1 / 0 / 1
- [FW_C-GigabitEthernet1/0/1] portswitch
- [FW_C-GigabitEthernet1/0/1] port link-type access
- [FW_C-GigabitEthernet1/0/1] quit
- [FW_C] interface gigabitethernet 1 / 0 / 2
- [FW_C-GigabitEthernet1/0/2] portswitch
- [FW_C-GigabitEthernet1/0/2] port link-type access
- [FW_C-GigabitEthernet1/0/2] quit
- 复制代码
- [FW_C] interface vlanif 1
- [FW_C-Vlanif1] ip address 10.2.1.3 255.255.255.0
- [FW_C-Vlanif1] quit
- 复制代码
- [FW_C] firewall zone untrust
- [FW_C-zone-untrust] add interface gigabitethernet 1 / 0 / 1
- [FW_C-zone-untrust] quit
- [FW_C] firewall zone trust
- [FW_C-zone-trust] add interface gigabitethernet 1 / 0 / 2
- [FW_C-zone-trust] quit
- 复制代码
配置安全策略。
- [FW_C] security-policy
- [FW_C-policy-security] rule name 1
- [FW_C-policy-security-rule-1] source-zone trust
- [FW_C-policy-security-rule-1] destination-zone untrust
- [FW_C-policy-security-rule-1] source-address 10.4.1.0 24
- [FW_C-policy-security-rule-1] destination-address 10.1.1.0 24
- [FW_C-policy-security-rule-1] action permit
- [FW_C-policy-security-rule-1] quit
- [FW_C-policy-security] rule name 2
- [FW_C-policy-security-rule-2] source-zone untrust
- [FW_C-policy-security-rule-2] destination-zone trust
- [FW_C-policy-security-rule-2] source-address 10.1.1.0 24
- [FW_C-policy-security-rule-2] destination-address 10.4.1.0 24
- [FW_C-policy-security-rule-2] action permit
- [FW_C-policy-security-rule-2] quit
- 复制代码
- [FW_C-policy-security] rule name 3
- [FW_C-policy-security-rule-3] source-zone local
- [FW_C-policy-security-rule-3] destination-zone untrust
- [FW_C-policy-security-rule-3] source-address 10.1.3.0 24
- [FW_C-policy-security-rule-3] destination-address 1.1.1.0 24
- [FW_C-policy-security-rule-3] action permit
- [FW_C-policy-security-rule-3] quit
- [FW_C-policy-security] rule name 4
- [FW_C-policy-security-rule-4] source-zone untrust
- [FW_C-policy-security-rule-4] destination-zone local
- [FW_C-policy-security-rule-4] source-address 1.1.1.0 24
- [FW_C-policy-security-rule-4] destination-address 10.1.3.0 24
- [FW_C-policy-security-rule-4] action permit
- [FW_C-policy-security-rule-4] quit
- [FW_C-policy-security] quit
- 复制代码
配置需要保护的数据流。
- [FW_C] acl 3001
- [FW_C-acl-adv-3001] rule 5 permit ip source 10.4.1.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
- [FW_C-acl-adv-3001] quit
- 复制代码
配置IPSec。
- [FW_C] ipsec proposal p1
- [FW_C-ipsec-proposal-p1] encapsulation-mode tunnel
- [FW_C-ipsec-proposal-p1] transform esp
- [FW_C-ipsec-proposal-p1] esp authentication-algorithm sha2- 256
- [FW_C-ipsec-proposal-p1] esp encryption-algorithm aes- 256
- [FW_C-ipsec-proposal-p1] quit
- 复制代码
- [FW_C] ike proposal 1
- [FW_C-ike-proposal-1] authentication-method pre-share
- [FW_C-ike-proposal-1] authentication-algorithm sha2- 256
- [FW_C-ike-proposal-1] quit
- 复制代码
- [FW_C] ike peer peer1
- [FW_C-ike-peer-peer1] undo version 2
- [FW_C-ike-peer-peer1] ike-proposal 1
- [FW_C-ike-peer-peer1] pre-shared-key Admin @ 123
- [FW_C-ike-peer-peer1] quit
- 复制代码
- [FW_C] ipsec policy-template template1 1
- [FW_C-ipsec-policy-template-template1-1] security acl 3001
- [FW_C-ipsec-policy-template-template1-1] proposal p1
- [FW_C-ipsec-policy-template-template1-1] ike-peer peer1
- [FW_C-ipsec-policy-template-template1-1] quit
- [FW_C] ipsec policy policy1 1 isakmp template template1
- 复制代码
- [FW_C] interface gigabitethernet 1 / 0 / 1
- [FW_C-GigabitEthernet1/0/1] ipsec policy policy1
- [FW_C-GigabitEthernet1/0/1] quit
- 复制代码
- [FW_C] ip route- static 10.1.1.0 255.255.255.0 10.2.1.1
- 复制代码
配置L3SW(只给出关键配置的数据,具体配置过程略)。
结果验证
- <FW_C> display ipsec sa brief
- Current ipsec sa num:2
-
- Spu board slot 1, cpu 1 ipsec sa information:
- Number of SAs:2
- Src address Dst address SPI VPN Protocol Algorithm
- -------------------------------------------------------------------------------
- 1.1.1.1 3.1.1.1 4001819557 ESP E:AES-256 A:SHA2-256-128
- 3.1.1.1 1.1.1.1 3923280450 ESP E:AES-256 A:SHA2-256-128
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。