• 华为防火墙:GRE over IPSec


    华为防火墙:GRE over IPSec-(ipsec安全策略方式)-(点到点)-(静态路由)

    1、Internet上仅配置IP地址

    2、FW-A和FW-B之间配置GRE over ipsec tunnel隧道

    3、配置静态路由使A-B两个网络互通

    防火墙安全策略配置

    源安全区域

    目的安全区域

    源地址

    目的地址

    untrust

    local

    gre-remote-公网IP

    gre-local-公网IP

    local

    untrust

    gre-local-公网IP

    gre-remote-公网IP

    trust

    tunnel接口所在区域

    reg-local-匹配流量

    gre-remote-匹配流量

    tunnel接口所在区域

    trust

    gre-remote-匹配流量

    gre-local-匹配流量

    ACL配置A-B两端的公网地址(GRE数据流

    ---------------------------------------------------------------------------------------------------------------------------------

    FW-A配置

    1. 基本配置
    2. [FW-A]int GigabitEthernet 1/0/0
    3. [FW-A-GigabitEthernet1/0/0]ip add 10.1.1.1 30
    4. [FW-A-GigabitEthernet1/0/0]q
    5. [FW-A]int GigabitEthernet 1/0/1
    6. [FW-A-GigabitEthernet1/0/1]ip add 172.16.10.254 24
    7. [FW-A-GigabitEthernet1/0/1]q
    8. [FW-A]firewall zone trust
    9. [FW-A-zone-trust]add interface GigabitEthernet 1/0/1
    10. [FW-A-zone-trust]q
    11. [FW-A]firewall zone untrust
    12. [FW-A-zone-untrust]add interface g1/0/0
    13. [FW-A-zone-untrust]q
    14. 配置gre tunnel
    15. [FW-A]interface Tunnel 1
    16. [FW-A-Tunnel1] description to_network-b
    17. [FW-A-Tunnel1] ip address 1.1.1.1 24
    18. [FW-A-Tunnel1] tunnel-protocol gre
    19. [FW-A-Tunnel1] source 10.1.1.1
    20. [FW-A-Tunnel1] destination 20.1.1.1
    21. [FW-A-Tunnel1] gre key cipher 123456
    22. [FW-A-Tunnel1] quit
    23. [FW-A]firewall zone name gre
    24. [FW-A-zone-gre] set priority 10
    25. [FW-A-zone-gre] add interface Tunnel1
    26. [FW-A-zone-gre] quit
    27. 配置路由
    28. [FW-A]ip route-static 0.0.0.0 0.0.0.0 10.1.1.2
    29. [FW-A]ip route-static 172.16.20.0 255.255.255.0 Tunnel 1
    30. 配置ipsec
    31. ACL配置A-B两端的公网地址(GRE数据流)
    32. [FW-A]acl number 3000
    33. [FW-A-acl-adv-3000] rule 5 permit ip source 10.1.1.1 0 destination 20.1.1.1 0
    34. [FW-A-acl-adv-3000]quit
    35. [FW-A]ike proposal 10
    36. [FW-A-ike-proposal-10] encryption-algorithm aes-256
    37. [FW-A-ike-proposal-10] dh group18
    38. [FW-A-ike-proposal-10] authentication-algorithm sha2-512
    39. [FW-A-ike-proposal-10] authentication-method pre-share
    40. [FW-A-ike-proposal-10] integrity-algorithm hmac-sha2-256
    41. [FW-A-ike-proposal-10] prf hmac-sha2-256
    42. [FW-A-ike-proposal-10] quit
    43. [FW-A]ike peer fw
    44. [FW-A-ike-peer-fw] exchange-mode main
    45. [FW-A-ike-peer-fw] pre-shared-key huawei
    46. [FW-A-ike-peer-fw] ike-proposal 10
    47. [FW-A-ike-peer-fw] remote-address 20.1.1.1
    48. [FW-A-ike-peer-fw] quit
    49. [FW-A]ipsec proposal 10
    50. [FW-A-ipsec-proposal-10] transform esp
    51. [FW-A-ipsec-proposal-10] encapsulation-mode tunnel
    52. [FW-A-ipsec-proposal-10] esp authentication-algorithm sha2-512
    53. [FW-A-ipsec-proposal-10] esp encryption-algorithm aes-256
    54. [FW-A-ipsec-proposal-10] quit
    55. [FW-A]ipsec policy ipsec 1 isakmp
    56. [FW-A-ipsec-policy-isakmp-ipsec-1] security acl 3000
    57. [FW-A-ipsec-policy-isakmp-ipsec-1] ike-peer fw
    58. [FW-A-ipsec-policy-isakmp-ipsec-1] proposal 10
    59. [FW-A-ipsec-policy-isakmp-ipsec-1] quit
    60. [FW-A]interface GigabitEthernet1/0/0
    61. [FW-A-GigabitEthernet1/0/0] ipsec policy ipsec
    62. [FW-A-GigabitEthernet1/0/0] quit
    63. 配置安全策略
    64. [FW-A]security-policy
    65. [FW-A-policy-security] rule name local_remote
    66. [FW-A-policy-security-rule-local_remote] source-zone local
    67. [FW-A-policy-security-rule-local_remote] destination-zone untrust
    68. [FW-A-policy-security-rule-local_remote] source-address 10.1.1.1 0.0.0.0
    69. [FW-A-policy-security-rule-local_remote] destination-address 20.1.1.1 0.0.0.0
    70. [FW-A-policy-security-rule-local_remote] action permit
    71. [FW-A-policy-security-rule-local_remote] quit
    72. [FW-A-policy-security] rule name remote_local
    73. [FW-A-policy-security-rule-remote_local] source-zone untrust
    74. [FW-A-policy-security-rule-remote_local] destination-zone local
    75. [FW-A-policy-security-rule-remote_local] source-address 20.1.1.1 0.0.0.0
    76. [FW-A-policy-security-rule-remote_local] destination-address 10.1.1.1 0.0.0.0
    77. [FW-A-policy-security-rule-remote_local] action permit
    78. [FW-A-policy-security-rule-remote_local] quit
    79. [FW-A-policy-security] rule name neiwang_a-neiwang_b
    80. [FW-A-policy-security-rule-neiwang_a-neiwang_b] source-zone trust
    81. [FW-A-policy-security-rule-neiwang_a-neiwang_b] destination-zone gre
    82. [FW-A-policy-security-rule-neiwang_a-neiwang_b] source-address 172.16.10.0 mask 255.255.255.0
    83. [FW-A-policy-security-rule-neiwang_a-neiwang_b] destination-address 172.16.20.0 mask 255.255.255.0
    84. [FW-A-policy-security-rule-neiwang_a-neiwang_b] action permit
    85. [FW-A-policy-security-rule-neiwang_a-neiwang_b] quit
    86. [FW-A-policy-security] rule name neiwang_b-neiwang_a
    87. [FW-A-policy-security-rule-neiwang_b-neiwang_a] source-zone gre
    88. [FW-A-policy-security-rule-neiwang_b-neiwang_a] destination-zone trust
    89. [FW-A-policy-security-rule-neiwang_b-neiwang_a] source-address 172.16.20.0 mask 255.255.255.0
    90. [FW-A-policy-security-rule-neiwang_b-neiwang_a] destination-address 172.16.10.0 mask 255.255.255.0
    91. [FW-A-policy-security-rule-neiwang_b-neiwang_a] action permit
    92. [FW-A-policy-security-rule-neiwang_b-neiwang_a] quit
    93. [FW-A-policy-security]q

    FW-B配置

    1. [FW-B]int GigabitEthernet 1/0/0
    2. [FW-B-GigabitEthernet1/0/0]ip add 20.1.1.1 30
    3. [FW-B-GigabitEthernet1/0/0]q
    4. [FW-B]int GigabitEthernet 1/0/1
    5. [FW-B-GigabitEthernet1/0/1]ip add 172.16.20.254 24
    6. [FW-B-GigabitEthernet1/0/1]q
    7. [FW-B]firewall zone trust
    8. [FW-B-zone-trust]add interface GigabitEthernet 1/0/1
    9. [FW-B-zone-trust]q
    10. [FW-B]firewall zone untrust
    11. [FW-B-zone-untrust]add interface g1/0/0
    12. [FW-B-zone-untrust]q
    13. [FW-B]interface Tunnel 1
    14. [FW-B-Tunnel1] description to_network-a
    15. [FW-B-Tunnel1] ip address 1.1.1.2 255.255.255.0
    16. [FW-B-Tunnel1] tunnel-protocol gre
    17. [FW-B-Tunnel1] source 20.1.1.1
    18. [FW-B-Tunnel1] destination 10.1.1.1
    19. [FW-B-Tunnel1] gre key cipher 123456
    20. [FW-B-Tunnel1] quit
    21. [FW-B]ip route-static 0.0.0.0 0.0.0.0 20.1.1.2
    22. [FW-B]ip route-static 172.16.10.0 24 Tunnel 1
    23. [FW-B]firewall zone name gre
    24. [FW-B-zone-gre] set priority 10
    25. [FW-B-zone-gre] add interface Tunnel1
    26. [FW-B-zone-gre] quit
    27. [FW-B]acl number 3000
    28. [FW-B-acl-adv-3000] rule 5 permit ip source 20.1.1.1 0 destination 10.1.1.1 0
    29. [FW-B-acl-adv-3000]quit
    30. [FW-B]ike proposal 10
    31. [FW-B-ike-proposal-10] encryption-algorithm aes-256
    32. [FW-B-ike-proposal-10] dh group18
    33. [FW-B-ike-proposal-10] authentication-algorithm sha2-512
    34. [FW-B-ike-proposal-10] authentication-method pre-share
    35. [FW-B-ike-proposal-10] integrity-algorithm hmac-sha2-256
    36. [FW-B-ike-proposal-10] prf hmac-sha2-256
    37. [FW-B-ike-proposal-10] quit
    38. [FW-B]ike peer fw
    39. [FW-B-ike-peer-fw] exchange-mode main
    40. [FW-B-ike-peer-fw] pre-shared-key huawei
    41. [FW-B-ike-peer-fw] ike-proposal 10
    42. [FW-B-ike-peer-fw] remote-address 10.1.1.1
    43. [FW-B-ike-peer-fw] quit
    44. [FW-B]ipsec proposal 10
    45. [FW-B-ipsec-proposal-10] transform esp
    46. [FW-B-ipsec-proposal-10] encapsulation-mode tunnel
    47. [FW-B-ipsec-proposal-10] esp authentication-algorithm sha2-512
    48. [FW-B-ipsec-proposal-10] esp encryption-algorithm aes-256
    49. [FW-B-ipsec-proposal-10] quit
    50. [FW-B]ipsec policy ipsec 1 isakmp
    51. [FW-B-ipsec-policy-isakmp-ipsec-1] security acl 3000
    52. [FW-B-ipsec-policy-isakmp-ipsec-1] ike-peer fw
    53. [FW-B-ipsec-policy-isakmp-ipsec-1]
    54. [FW-B-ipsec-policy-isakmp-ipsec-1] proposal 10
    55. [FW-B-ipsec-policy-isakmp-ipsec-1] quit
    56. [FW-B]interface GigabitEthernet1/0/0
    57. [FW-B-GigabitEthernet1/0/0] ipsec policy ipsec
    58. [FW-B-GigabitEthernet1/0/0] quit
    59. [FW-B]security-policy
    60. [FW-B-policy-security] rule name local_remote
    61. [FW-B-policy-security-rule-local_remote] source-zone local
    62. [FW-B-policy-security-rule-local_remote] destination-zone untrust
    63. [FW-B-policy-security-rule-local_remote] source-address 20.1.1.1 0.0.0.0
    64. [FW-B-policy-security-rule-local_remote] destination-address 10.1.1.1 0.0.0.0
    65. [FW-B-policy-security-rule-local_remote] action permit
    66. [FW-B-policy-security-rule-local_remote] q
    67. [FW-B-policy-security] rule name remote_local
    68. [FW-B-policy-security-rule-remote_local] source-zone untrust
    69. [FW-B-policy-security-rule-remote_local] destination-zone local
    70. [FW-B-policy-security-rule-remote_local] source-address 10.1.1.1 0.0.0.0
    71. [FW-B-policy-security-rule-remote_local] destination-address 20.1.1.1 0.0.0.0
    72. [FW-B-policy-security-rule-remote_local] action permit
    73. [FW-B-policy-security-rule-remote_local] q
    74. [FW-B-policy-security]rule name neiwang_b-neiwang_ac
    75. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] source-zone trust
    76. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] destination-zone gre
    77. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] source-address 172.16.20.0 mask 255.255.255.0
    78. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] destination-address 172.16.10.0 mask 255.255.255.0
    79. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] action permit
    80. [FW-B-policy-security-rule-neiwang_b-neiwang_ac] q
    81. [FW-B-policy-security] rule name neiwang_ac-neiwang_b
    82. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] source-zone gre
    83. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] destination-zone trust
    84. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] source-address 172.16.10.0 mask 255.255.255.0
    85. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] destination-address 172.16.20.0 mask 255.255.255.0
    86. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] action permit
    87. [FW-B-policy-security-rule-neiwang_ac-neiwang_b] q
    88. [FW-B-policy-security]q

    抓包验证

    普通gre tunnel抓取到的数据包 没有加密

    Gre over ipsec 抓取到的数据包 经过加密 

     

     

  • 相关阅读:
    Java8 新特性之Stream(三)-- Stream的终结操作
    智能导诊(Intelligent Guidance,IG)源码
    7000+字图文并茂解带你深入理解java锁升级的每个细节
    RK平台ADB不识别问题排查
    Springboot 实践(21)服务熔断机制
    SAP ABAP 动态结构实现发送企业微信应用消息
    1 什么是MyBatis?
    在pycharm中导入sklearn库失败到成功
    Spring Boot 注解
    Python程序龟速过载怎么办,asyncio并发教程来解决
  • 原文地址:https://blog.csdn.net/u010612642/article/details/126061867