当前位置:   article > 正文

华为防火墙技术之NAT Server_华为防火墙配置nat server

华为防火墙配置nat server

Nat server技术原理

Nat server:指定公有地址:端口私有地址:端口形成一对一映射关系——映射表。这也是Nat server与其他nat的区别之一,Nat server可以指定端口进行映射。

网络topo如下:

 配置过程:

FW

首先对FW进行配置,给接口配置IP、掩码

顺便把接口服务打开,为了方便直接开启所有服务。(生产中建议按需开启)

创建域,并将接口加入。

创建策略。

  1. ##配置IP
  2. [USG6000V1]int g1/0/0
  3. [USG6000V1-GigabitEthernet1/0/0]ip add 192.168.1.254 24
  4. [USG6000V1-GigabitEthernet1/0/0]service-manage all p
  5. [USG6000V1-GigabitEthernet1/0/0]int g1/0/1
  6. [USG6000V1-GigabitEthernet1/0/1]ip add 200.1.1.1 24
  7. [USG6000V1-GigabitEthernet1/0/1]service-manage all permit
  8. [USG6000V1-GigabitEthernet1/0/1]q
  9. ##端口加入域
  10. [USG6000V1]firewall zone dmz
  11. [USG6000V1-zone-dmz]add int g1/0/0
  12. [USG6000V1-zone-dmz]q
  13. [USG6000V1]firewall zone untrust
  14. [USG6000V1-zone-untrust]add int g1/0/1
  15. [USG6000V1-zone-untrust]q
  16. ##放行策略
  17. [USG6000V1]security-policy
  18. [USG6000V1-policy-security]rule name 1
  19. [USG6000V1-policy-security-rule-1]source-zone dmz
  20. [USG6000V1-policy-security-rule-1]destination-zone untrust
  21. [USG6000V1-policy-security-rule-1]source-address 192.168.1.0 24
  22. [USG6000V1-policy-security-rule-1]action permit
  23. [USG6000V1]security-policy
  24. [USG6000V1-policy-security]rule name 2
  25. [USG6000V1-policy-security-rule-2]source-zone untrust
  26. [USG6000V1-policy-security-rule-2]destination-zone dmz
  27. [USG6000V1-policy-security-rule-2]destination-address 192.168.1.0 24
  28. [USG6000V1-policy-security-rule-2]action permit
  29. ##配置默认路由
  30. [USG6000V1]ip route-static 0.0.0.0 0.0.0.0 200.1.1.2
  31. ​##基于端口映射
  32. [USG6000V1]nat server protocol tcp global 200.1.1.1 8888 inside 192.168.1.1 80

R2:
配置接口IP即可。

  1. [Huawei]int g0/0/0
  2. [Huawei-GigabitEthernet0/0/0]ip add 200.1.1.2 24
  3. [Huawei-GigabitEthernet0/0/0]int g0/0/1
  4. [Huawei-GigabitEthernet0/0/1]ip add 172.16.1.254 24

验证:

给server和client配置IP。

 

 

 如下所示:Client可以成功访问内网内网服务器。

也可以查看会话表信息

[USG6000V1]dis firewall session table verbose

会话表不存在的原因,可能是:

  • 访问报文没有到达防火墙。
  • 访问报文被防火墙安全策略丢包。
  • 防火墙没有到内网服务器的路由。
  • 防火墙防攻击导致丢包,例如IP spoofing。

如果会话表项存在,但是服务器响应报文数量为0,可能的原因:服务器服务未开启,中间设备没有到虚拟IP地址段的路由:

  1. <HUAWEI> display firewall session table verbose source global 10.100.10.100 destination global 192.168.10.100
  2. http VPN:public --> public ID: a48f3fdcb655030b65720d507
  3. Zone: untrust--> trust TTL: 24:00:00 Left: 23:59:59
  4. Recv Interface: GigabitEthernet1/0/7
  5. Interface: GigabitEthernet1/0/0 NextHop: 192.168.10.1 MAC: 00-03-fa-56-c2-4c
  6. <--packets:9 bytes:8772 -->packets:8 bytes:728 //8表示发送给服务器报文的数量,9表示服务器响应报文数量
  7. 10.100.10.100:63334-->192.168.10.100:80 PolicyName: SSLVPN

 以上就是Nat Server配置过程及验证,如果问题望指出,希望可以一起进步,加油~

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/454083
推荐阅读
相关标签
  

闽ICP备14008679号