• 华为防火墙 DMZ 设置


    DMZ 是英文"Demilitarized Zone"的缩写,中文名称为"隔离区"

    它是为了解决安装防火墙后外部网络不能访问内部网络服务器的问题,而设立的一个位于内部网络与外部网络之间的缓冲区,在这个网络区域内可以放置一些公开的服务器资源。

    例如FTP服务器、E-Mail服务器及网站服务器等允许外部用户访问这些服务器,但不可能接触到存放在内网中的信息,就算黑客入侵DMZ服务器,也不会影响到公司内部网络安全,不允许任何外部网络的直接访问,实现内外网分离,在企业的信息安全防护加了一道屏障。

    环境:

    虚拟机2台,Windows10,Windows Server 2012 R2

    外网IP 3个 192.168.137.11,192.168.137.12,192.168.137.13

    实现的功能:

    1、内网客户端和DMZ服务器可以上网

    2、内网可以访问DMZ服务器,但是DMZ服务器不能访问内网

    3、外网可以远程桌面DMZ服务器

    拓扑图如下:

    一、外网 

    1、配置外网IP

    1. sys
    2. [Huawei]sys R1
    3. [FW1]un in en
    4. # 开启 DHCP
    5. [FW1]dhcp enable
    6. # 配置三个外网
    7. [FW1]int g1/0/0
    8. [FW1-GigabitEthernet1/0/0]ip addr 192.168.137.10 24
    9. [FW1-GigabitEthernet1/0/0]ip addr 192.168.137.11 24 sub
    10. [FW1-GigabitEthernet1/0/0]ip addr 192.168.137.12 24 sub
    11. [FW1-GigabitEthernet1/0/0]service-manage all permit
    12. [FW1-GigabitEthernet1/0/0]quit
    13. # 配置外网区域
    14. [FW1]firewall zone untrust
    15. [FW1-zone-untrust]add int g1/0/0
    16. [FW1-zone-untrust]quit

    2、安全策略

    1. # 安全策略
    2. [FW1]security-policy
    3. [FW1-policy-security]rule name "untrust to local"
    4. [FW1-policy-security-rule-untrust to local]source-zone untrust
    5. [FW1-policy-security-rule-untrust to local]destination-zone local
    6. [FW1-policy-security-rule-untrust to local]action permit
    7. [FW1-policy-security-rule-untrust to local]rule name "local to untrust"
    8. [FW1-policy-security-rule-local to untrust]source-zone local
    9. [FW1-policy-security-rule-local to untrust]destination-zone untrust
    10. [FW1-policy-security-rule-local to untrust]action permit
    11. [FW1-policy-security-rule-local to untrust]rule name "trust to untrust"
    12. [FW1-policy-security-rule-trust to untrust]source-zone trust
    13. [FW1-policy-security-rule-trust to untrust]destination-zone untrust
    14. [FW1-policy-security-rule-trust to untrust]source-address address-set 192.168.100.*
    15. [FW1-policy-security-rule-trust to untrust]action permit
    16. [FW1-policy-security-rule-trust to untrust]quit
    二、内网 

    1、配置内网IP

    1. # 配置内网
    2. [FW1-policy-security]int g1/0/1
    3. [FW1-GigabitEthernet1/0/1]ip addr 192.168.100.254 24
    4. [FW1-GigabitEthernet1/0/1]dhcp select int
    5. [FW1-GigabitEthernet1/0/1]dhcp server dns-list 114.114.114.114
    6. [FW1-GigabitEthernet1/0/1]service-manage ping permit
    7. [FW1-GigabitEthernet1/0/1]quit
    8. # 配置内网区域
    9. [FW1]firewall zone trust
    10. [FW1-zone-trust]add int g1/0/1
    11. [FW1-zone-trust]quit
    12. # 配置地址列表
    13. [FW1]ip address-set 192.168.100.* type object
    14. [FW1-object-address-set-192.168.100.*]address 0 192.168.100.0 mask 24
    15. [FW1-object-address-set-192.168.100.*]quit
    16. # 配置Nat策略实现上网
    17. [FW1]nat-policy
    18. [FW1-policy-nat]rule name "snat 1"
    19. [FW1-policy-nat-rule-snat 1]source-zone trust
    20. [FW1-policy-nat-rule-snat 1]egress-interface GigabitEthernet1/0/0
    21. [FW1-policy-nat-rule-snat 1]action source-nat easy-ip
    22. [FW1-policy-nat-rule-snat 1]quit

    2、配置路由和DNS

    1. # 设置静态路由
    2. [FW1-policy-nat]ip route-static 0.0.0.0 0.0.0.0 192.168.137.1
    3. # 防火墙配置 DNS
    4. [FW1]dns resolve
    5. [FW1]dns server 114.114.114.114
    三、DMZ 

    1、配置DMZ区域IP

    1. # 配置DMZ
    2. [FW1]int g1/0/2
    3. [FW1-GigabitEthernet1/0/2]ip addr 192.168.200.254 24
    4. [FW1-GigabitEthernet1/0/2]dhcp select int
    5. [FW1-GigabitEthernet1/0/2]dhcp server dns-list 114.114.114.114
    6. [FW1-GigabitEthernet1/0/2]service-manage ping permit
    7. [FW1-GigabitEthernet1/0/2]quit
    8. # 配置DMZ区域
    9. [FW1]firewall zone dmz
    10. [FW1-zone-dmz]add int g1/0/2
    11. [FW1-zone-dmz]quit
    12. # 配置地址列表
    13. [FW1]ip address-set 192.168.200.* type object
    14. [FW1-object-address-set-192.168.200.*]address 0 192.168.200.0 mask 24
    15. [FW1-object-address-set-192.168.200.*]quit

    2、配置安全策略 

    1. # 安全策略
    2. [FW1]security-policy
    3. [FW1-policy-security]rule name "dmz to untrust"
    4. [FW1-policy-security-rule-dmz to untrust]source-zone dmz
    5. [FW1-policy-security-rule-dmz to untrust]destination-zone untrust
    6. [FW1-policy-security-rule-dmz to untrust]source-address address-set 192.168.200.*
    7. [FW1-policy-security-rule-dmz to untrust]action permit
    8. [FW1-policy-security-rule-dmz to untrust]rule name "untrust to dmz"
    9. [FW1-policy-security-rule-untrust to dmz]source-zone untrust
    10. [FW1-policy-security-rule-untrust to dmz]destination-zone dmz
    11. [FW1-policy-security-rule-untrust to dmz]destination-address address-set 192.168.200.*
    12. [FW1-policy-security-rule-untrust to dmz]action permit
    13. [FW1-policy-security-rule-untrust to dmz]rule name "trust to dmz"
    14. [FW1-policy-security-rule-trust to dmz]source-zone trust
    15. [FW1-policy-security-rule-trust to dmz]destination-zone dmz
    16. [FW1-policy-security-rule-trust to dmz]source-address address-set 192.168.100.*
    17. [FW1-policy-security-rule-trust to dmz]destination-address address-set 192.168.200.*
    18. [FW1-policy-security-rule-trust to dmz]action permit
    19. [FW1-policy-security-rule-trust to dmz]quit

    3、配置NAT策略

    1. # nat策略 实现上网
    2. [FW1-policy-security]nat-policy
    3. [FW1-policy-nat]rule name "snat 2"
    4. [FW1-policy-nat-rule-snat 2]source-zone dmz
    5. [FW1-policy-nat-rule-snat 2]egress-interface GigabitEthernet1/0/0
    6. [FW1-policy-nat-rule-snat 2]action source-nat easy-ip
    7. # nat策略 实现目标端口转换
    8. [FW1-policy-nat-rule-snat 2]rule name "dnat 1"
    9. [FW1-policy-nat-rule-dnat 1]source-zone untrust
    10. [FW1-policy-nat-rule-dnat 1]destination-address 192.168.137.11 mask 255.255.255.255
    11. [FW1-policy-nat-rule-dnat 1]service protocol tcp source-port 0 to 65535 destination-port 33389
    12. [FW1-policy-nat-rule-dnat 1]action destination-nat static port-to-port address 192.168.200.2 3389
    13. [FW1-policy-nat-rule-dnat 1]quit
    四、验证 

    1、客户端上网

    2、服务器上网 

    3、内网可以访问DMZ

    4、DMZ 不能访问 内网

    4、验证目的端口转换

    当我们访问 192.168.137.11 33389 端口时,已成功转到换 Win2012 这台服务器的 3389 端口上面

  • 相关阅读:
    安泰线束测试仪科普:影响线束电阻值的因素有哪些
    软件测试技术之如何编写测试用例(5)
    Sigrity仿真之POWER DC操作步骤
    数字孪生智慧工厂三维可视化系统解决方案,打造新一代智慧工厂
    引领创新浪潮:“Polygon探寻新技术、新治理、新代币的未来之路!“
    迅为iTOP-2K1000开发板龙芯中科国产64位Loognix系统工业核心主板
    前端工程化小记
    【Audio】正弦波生成原理及C++代码
    前端基础之《Bootstrap(4)—全局CSS样式_图片、辅助类、响应式工具》
    最新科目一攻略(新规)
  • 原文地址:https://blog.csdn.net/mshxuyi/article/details/134523791