设为首页收藏本站language 语言切换
查看: 3136|回复: 2
收起左侧

[分享] 华为防火墙配置点到多点IPSec隧道

[复制链接]
 成长值: 63400
发表于 2019-9-4 10:35:58 | 显示全部楼层 |阅读模式
分支机构通过IPSec双VPN隧道连接到总公司和上级分支机构
市级分支机构通过PPPoE接入链路,分别向两个省级分支机构建立IPSec VPN隧道。且市级分支机构中不同的VLAN设备分别固定地访问不同的省级分支机构服务器。可以分别在两个省级分支机构建立策略模板方式的IPSec隧道。
组网需求
如图1所示,组网情况如下:
某企业按地域分为市级分支机构、省级分支机构、总部三个部分。USG_A、USG_B、USG_C分别作为对应区域的VPN网关设备。
市级分支机构由交换机连接三个系统,即ERP系统、OA系统和财务系统。
为节约IP资源,市级分支机构通过PPPoE拨号接入Internet网络。
该企业网络需实现以下需求:
市级分支机构中OA系统和ERP系统的数据需要发送给省级分支机构相应的服务器进行日常办公,财务系统的数据需要上报给总部的财务管理服务器进行分析。这两种通信中,传输的数据都需要加密。
市级分支机构三个系统之间允许进行通信,三个系统中设备的IP地址都要由USG_A统一分配。
市级分支机构三个系统不允许以任何形式访问Internet。
图1 配置市级分支机构通过双VPN隧道连接到总部和省级分支机构
1.jpg
网络规划
由于不同的系统需要实现不同的业务,为保证业务独立,故将三个系统分别划分在3个VLAN中,即VLAN10、VLAN20和VLAN30。VLAN10为OA系统使用;VLAN20为ERP系统使用;VLAN30为财务系统使用。
为方便管理,VLAN10、VLAN20和VLAN30中的设备设置为自动获取IP地址,由USG_A通过DHCP来分配地址。
USG_A连接交换机的接口配置三个子接口,分别对应VLAN10、VLAN20和VLAN30。
市级分支机构和总部、市级分支机构和省级分支机构之间的通信数据都要经过IPSec加密,故需要在USG_A与USG_B之间以及USG_A和USG_C分别建立一条IPSec隧道。
配置IPSec隧道时,由市级分支机构系统主动发起连接,故总部和省级分支机构的VPN配置采用策略模板方式建立IPSec策略,接受市级分支机构发起的访问。
由于USG_A通过PPPoE拨号上网,没有固定IP地址,其IPSec策略要应用在Dialer接口上。

操作步骤
配置USG_A。
1 配置PPPoE拨号。
# 假设在PPPoE Server端的本地用户名设置为eee,密码设置为Admin@123,认证方式为PAP。
[USG_A] dialer-rule 9 ip permit
[USG_A] interface dialer 9
[USG_A-Dialer9] dialer user eee
[USG_A-Dialer9] dialer-group 9
[USG_A-Dialer9] dialer bundle 9
[USG_A-Dialer9] ip address ppp-negotiate
[USG_A-Dialer9] ppp pap local-user eee password cipher Admin@123
[USG_A-Dialer9] quit
[USG_A] interface GigabitEthernet 0/0/2
[USG_A-GigabitEthernet0/0/2] pppoe-client dial-bundle-number 9
[USG_A-GigabitEthernet0/0/2] quit
配置Dialer口后,可执行display pppoe-client session summary命令来查看PPPoE会话报文概要信息。出现以下结果后,说明拨号配置成功,并且已经分配了IP地址。
[USG_A] display pppoe-client session summary                           
PPPoE Client Session:                        
ID   Bundle  Dialer  Intf             Client-MAC    Server-MAC    State         
1    9       9       GE0/0/2          0022a1002259  0022a10011aa  PPPUP  [USG_A] disply ip interface brief
*down: administratively down                 
(s): spoofing                                
Interface                   IP Address      Physical Protocol Description      
Dialer9                     110.1.1.2        up       up(s)      
# 将接口加入到安全区域。
[USG_A] firewall zone untrust
[USG_A-zone-untrust] add interface GigabitEthernet 0/0/2
[USG_A-zone-untrust] add interface dialer 9
[USG_A-zone-untrust] quit
# 域间配置包过滤。
[USG_A] firewall packet-filter default permit all
窍门:
firewall packet-filter default permit all命令中,打开了所有安全区域间的包过滤。请根据网络情况关闭不需要开放的域间缺省包过滤。

2 配置市级分支机构内网IP地址。
# 配置子接口,并划分VLAN。在子接口上配置DHCP,为内网设备分配IP地址。
[USG_A] interface GigabitEthernet 0/0/1.1
[USG_A-GigabitEthernet0/0/1.1] vlan-type dot1q 10
[USG_A-GigabitEthernet0/0/1.1] ip address 10.10.10.1 255.255.255.0
[USG_A-GigabitEthernet0/0/1.1] dhcp select interface
[USG_A-GigabitEthernet0/0/1.1] quit[USG_A] interface GigabitEthernet 0/0/1.2
[USG_A-GigabitEthernet0/0/1.2] vlan-type dot1q 20
[USG_A-GigabitEthernet0/0/1.2] ip address 10.10.20.1 255.255.255.0
[USG_A-GigabitEthernet0/0/1.2] dhcp select interface
[USG_A-GigabitEthernet0/0/1.2] quit[USG_A] interface GigabitEthernet 0/0/1.3
[USG_A-GigabitEthernet0/0/1.3] vlan-type dot1q 30
[USG_A-GigabitEthernet0/0/1.3] ip address 192.168.1.1 255.255.255.0
[USG_A-GigabitEthernet0/0/1.3] dhcp select interface
[USG_A-GigabitEthernet0/0/1.3] quit
# 将接口加入到安全区域。
[USG_A] firewall zone trust
[USG_A-zone-trust] add interface GigabitEthernet 0/0/1.1
[USG_A-zone-trust] add interface GigabitEthernet 0/0/1.2
[USG_A-zone-trust] add interface GigabitEthernet 0/0/1.3
[USG_A-zone-trust] quit
配置完成后,在VLAN10、VLAN20和VLAN30的设备上都设置为自动获取IP地址,则可以看到被分配了与相应子接口在同一网段的IP地址。如,在VLAN10内的设备上可查看到自动获取了10.10.10.0/24网段的IP地址。

3 配置IPSec功能。
a配置访问控制列表,定义要保护的数据流。
# 配置源IP地址为10.10.0.0/16、目的IP地址为10.10.1.0/24的规则。
[USG_A] acl 3000
[USG_A-acl-adv-3000] rule permit ip source 10.10.0.0 0.0.255.255 destination 10.10.1.0 0.0.0.255
[USG_A-acl-adv-3000] quit
# 配置源IP地址为192.168.1.0/24、目的IP地址为10.10.2.0/24的规则。
[USG_A] acl 3001
[USG_A-acl-adv-3001] rule permit ip source 192.168.1.0 0.0.0.255 destination 10.10.2.0 0.0.0.255
[USG_A-acl-adv-3001] quit
b配置USG_A到达USG_B和USG_C的静态路由。
[USG_A] ip route-static 0.0.0.0 0.0.0.0 Dialer 9
c创建IPSec安全提议。
[USG_A] ipsec proposal tran1
[USG_A-ipsec-proposal-tran1] encapsulation-mode tunnel
[USG_A-ipsec-proposal-tran1] transform esp
[USG_A-ipsec-proposal-tran1] esp authentication-algorithm sha1
[USG_A-ipsec-proposal-tran1] esp encryption-algorithm des
[USG_A-ipsec-proposal-tran1] quit[USG_A] ipsec proposal tran2
[USG_A-ipsec-proposal-tran2] encapsulation-mode tunnel
[USG_A-ipsec-proposal-tran2] transform esp
[USG_A-ipsec-proposal-tran2] esp authentication-algorithm sha1
[USG_A-ipsec-proposal-tran2] esp encryption-algorithm des
[USG_A-ipsec-proposal-tran2] quit
d创建IKE安全提议。
[USG_A] ike proposal 10
[USG_A-ike-proposal-10] authentication-method pre-share
[USG_A-ike-proposal-10] authentication-algorithm md5
[USG_A-ike-proposal-10] quit
[USG_A] ike proposal 11
[USG_A-ike-proposal-11] authentication-method pre-share
[USG_A-ike-proposal-11] authentication-algorithm md5
[USG_A-ike-proposal-11] quit
e 配置IKE本地用户名。
[USG_A] ike local-name USG_A
f 配置IKE peer。
[USG_A] ike peer a1
[USG_A-ike-peer-a1] local-id-type fqdn
[USG_A-ike-peer-a1] remote-id USG_B
[USG_A-ike-peer-a1] remote-address 202.38.10.1
[USG_A-ike-peer-a1] ike-proposal 10
[USG_A-ike-peer-a1] pre-shared-key Key123
[USG_A-ike-peer-a1] quit[USG_A] ike peer a2
[USG_A-ike-peer-a2] local-id-type fqdn
[USG_A-ike-peer-a2] remote-id USG_C
[USG_A-ike-peer-a2] remote-address 202.38.20.1
[USG_A-ike-peer-a2] ike-proposal 11
[USG_A-ike-peer-a2] pre-shared-key Key456
[USG_A-ike-peer-a2] quit
g 创建安全策略。
[USG_A] ipsec policy map1 10 isakmp
[USG_A-ipsec-policy-isakmp-map1-10] security acl 3000
[USG_A-ipsec-policy-isakmp-map1-10] proposal tran1
[USG_A-ipsec-policy-isakmp-map1-10] ike-peer a1
[USG_A-ipsec-policy-isakmp-map1-10] quit[USG_A] ipsec policy map1 11 isakmp
[USG_A-ipsec-policy-isakmp-map1-11] security acl 3001
[USG_A-ipsec-policy-isakmp-map1-11] proposal tran2
[USG_A-ipsec-policy-isakmp-map1-11] ike-peer a2
[USG_A-ipsec-policy-isakmp-map1-11] quit
h 在Dialer接口上引用安全策略。
[USG_A] interface Dialer 9
[USG_A-Dialer9] ipsec policy map1
配置完成后,可执行display ipsec policy命令查看IPSec的配置情况。出现以下显示信息说明配置成功。
[USG_A] display ipsec policy name map1      

===========================================  
IPsec Policy Group: "map1"                  
Using interface: {Dialer9}                  
===========================================  

  -----------------------------              
  IPsec policy name: "map1"                  
  sequence number: 10                        
  mode: isakmp                              
  state: active  
  -----------------------------              
    security data flow : 3000               
    ike-peer name:  a1                       
    perfect forward secrecy: None            
    proposal name:  tran1                       
    IPsec sa local duration(time based): 22222 seconds                          
    sa soft-duration time-based buffer: 22200 seconds                           
    sa soft-duration traffic-based buffer: 22200 kilobytes                     
    IPsec sa local duration(traffic based): 22222 kilobytes                     
    IPSec sa anti-replay: use global                                            
    IPSec sa anti-replay window-size: use global           
  -----------------------------              
  IPsec policy name: "map1"                  
  sequence number: 11                        
  mode: isakmp                              
  state: active  
  -----------------------------              
    security data flow : 3001               
    ike-peer name:  a2                       
    perfect forward secrecy: None            
    proposal name:  tran2                       
    IPsec sa local duration(time based): 22222 seconds                          
    sa soft-duration time-based buffer: 22200 seconds                           
    sa soft-duration traffic-based buffer: 22200 kilobytes                     
    IPsec sa local duration(traffic based): 22222 kilobytes                     
    IPSec sa anti-replay: use global                                            
    IPSec sa anti-replay window-size: use global

配置USG_B的IPSec功能。
1 配置访问控制列表,定义要保护的数据流。
# 配置源IP地址为10.10.1.0/24、目的地址为10.10.0.0/16的规则。
[USG_B] acl 3000
[USG_B-acl-adv-3000] rule permit ip source 10.10.1.0 0.0.0.255 destination 10.10.0.0 0.0.255.255
[USG_B-acl-adv-3000] quit
2 配置USG_B到达USG_A的静态路由,假设下一跳地址为202.38.10.2。
[USG_B] ip route-static 10.10.0.0 255.255.0.0 202.38.10.2
3 创建IPSec安全提议。
[USG_B] ipsec proposal tran1
[USG_B-ipsec-proposal-tran1] encapsulation-mode tunnel
[USG_B-ipsec-proposal-tran1] transform esp
[USG_B-ipsec-proposal-tran1] esp authentication-algorithm sha1
[USG_B-ipsec-proposal-tran1] esp encryption-algorithm des
[USG_B-ipsec-proposal-tran1] quit
4 创建IKE安全提议。
[USG_B] ike proposal 10
[USG_B-ike-proposal-10] authentication-method pre-share
[USG_B-ike-proposal-10] authentication-algorithm md5
[USG_B-ike-proposal-10] quit
5 配置IKE本地用户名。
[USG_B] ike local-name USG_B
6 配置IKE peer。
[USG_B] ike peer b
[USG_B-ike-peer-b] local-id-type fqdn
[USG_B-ike-peer-b] remote-id USG_A
[USG_B-ike-peer-b] ike-proposal 10
[USG_B-ike-peer-b] pre-shared-key Key123
[USG_B-ike-peer-b] quit
7 创建安全策略。
[USG_B] ipsec policy-template map_temp 1
[USG_B-ipsec-policy-templet-map_temp-1] security acl 3000
[USG_B-ipsec-policy-templet-map_temp-1] proposal tran1
[USG_B-ipsec-policy-templet-map_temp-1] ike-peer b
[USG_B-ipsec-policy-templet-map_temp-1] quit
[USG_B] ipsec policy map1 10 isakmp template map_temp
8 在物理接口上引用安全策略。
[USG_B] interface GigabitEthernet 0/0/2
[USG_B-GigabitEthernet0/0/2] ipsec policy map1
配置完成后,可执行display ipsec policy命令查看IPSec的配置情况。出现以下显示信息说明配置成功。
<USG_B> display ipsec policy name map1               
===========================================  
IPsec Policy Group: "map1"                  
Using interface: {GigabitEthernet0/0/2}                        
===========================================  
  -----------------------------              
  IPsec policy name: "map1"
  sequence number: 10                        
  mode: template                             
  state: active
  -----------------------------              
    policy template name: map_temp      

配置USG_C的IPSec功能。
1 配置访问控制列表,定义要保护的数据流。
# 配置源IP地址为10.10.2.0/24,目的地址为192.168.1.0/24的规则。
[USG_C] acl 3000
[USG_C-acl-adv-3000] rule permit ip source 10.10.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
[USG_C-acl-adv-3000] quit
2 配置USG_C到达USG_A的静态路由,假设下一跳地址为202.38.20.2。
[USG_C] ip route-static 192.168.1.0 255.255.255.0 202.38.20.2
3 创建IPSec安全提议。
[USG_C] ipsec proposal tran1
[USG_C-ipsec-proposal-tran1] encapsulation-mode tunnel
[USG_C-ipsec-proposal-tran1] transform esp
[USG_C-ipsec-proposal-tran1] esp authentication-algorithm sha1
[USG_C-ipsec-proposal-tran1] esp encryption-algorithm des
[USG_C-ipsec-proposal-tran1] quit
4 创建IKE安全提议。
[USG_C] ike proposal 10
[USG_C-ike-proposal-10] authentication-method pre-share
[USG_C-ike-proposal-10] authentication-algorithm md5
[USG_C-ike-proposal-10] quit
5 配置IKE本地用户名。
[USG_C] ike local-name USG_C
6 配置IKE peer。
[USG_C] ike peer c
[USG_C-ike-peer-c] local-id-type fqdn
[USG_C-ike-peer-c] remote-id USG_A
[USG_C-ike-peer-c] ike-proposal 10
[USG_C-ike-peer-c] pre-shared-key Key456
[USG_C-ike-peer-c] quit
7 创建安全策略。
[USG_C] ipsec policy-template map_temp 1
[USG_C-ipsec-policy-templet-map_temp-1] security acl 3000
[USG_C-ipsec-policy-templet-map_temp-1] proposal tran1
[USG_C-ipsec-policy-templet-map_temp-1] ike-peer c
[USG_C-ipsec-policy-templet-map_temp-1] quit
[USG_C] ipsec policy map1 10 isakmp template map_temp
8 在物理接口上引用安全策略。
[USG_C] interface GigabitEthernet 0/0/2
[USG_C-GigabitEthernet0/0/2] ipsec policy map1
配置完成后,可执行display ipsec policy命令查看IPSec的配置情况。出现以下显示信息说明配置成功。
<USG_C> display ipsec policy name map1         
===========================================  
IPsec Policy Group: "map1"                  
Using interface: {GigabitEthernet0/0/2}                        
===========================================  
  -----------------------------              
  IPsec policy name: "map1"
  sequence number: 10                        
  mode: template                             
  state: active
  -----------------------------              
    policy template name: map_temp                           




发表于 2019-9-10 16:57:42 来自手机 | 显示全部楼层
dhcp vlan那块我是看不懂的,因为小白
沙发 2019-9-10 16:57:42 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2019-11-26 17:34:16 | 显示全部楼层
好好学习天天向上
板凳 2019-11-26 17:34:16 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-2 14:55 , Processed in 0.058357 second(s), 14 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表