华为防火墙技术之NAT Server

Nat server技术原理

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

网络topo如下:

华为防火墙技术之NAT Server_第1张图片

 配置过程:

FW:

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

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

创建域,并将接口加入。

创建策略。

​
​
​
##配置IP
[USG6000V1]int g1/0/0
[USG6000V1-GigabitEthernet1/0/0]ip add 192.168.1.254 24
[USG6000V1-GigabitEthernet1/0/0]service-manage all p
[USG6000V1-GigabitEthernet1/0/0]int g1/0/1
[USG6000V1-GigabitEthernet1/0/1]ip add 200.1.1.1 24
[USG6000V1-GigabitEthernet1/0/1]service-manage all permit 
[USG6000V1-GigabitEthernet1/0/1]q

##端口加入域
[USG6000V1]firewall zone dmz 
[USG6000V1-zone-dmz]add int g1/0/0
[USG6000V1-zone-dmz]q

[USG6000V1]firewall zone untrust
[USG6000V1-zone-untrust]add int g1/0/1
[USG6000V1-zone-untrust]q

##放行策略
[USG6000V1]security-policy 
[USG6000V1-policy-security]rule name 1
[USG6000V1-policy-security-rule-1]source-zone dmz
[USG6000V1-policy-security-rule-1]destination-zone untrust 
[USG6000V1-policy-security-rule-1]source-address 192.168.1.0 24
[USG6000V1-policy-security-rule-1]action permit 

[USG6000V1]security-policy 
[USG6000V1-policy-security]rule name 2
[USG6000V1-policy-security-rule-2]source-zone untrust 
[USG6000V1-policy-security-rule-2]destination-zone dmz
[USG6000V1-policy-security-rule-2]destination-address 192.168.1.0 24
[USG6000V1-policy-security-rule-2]action permit 

##配置默认路由
[USG6000V1]ip route-static 0.0.0.0 0.0.0.0 200.1.1.2

​##基于端口映射
[USG6000V1]nat server protocol tcp global 200.1.1.1 8888 inside 192.168.1.1 80

R2:
配置接口IP即可。

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 200.1.1.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 172.16.1.254 24

验证:

给server和client配置IP。

华为防火墙技术之NAT Server_第2张图片

 华为防火墙技术之NAT Server_第3张图片

 华为防火墙技术之NAT Server_第4张图片

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

华为防火墙技术之NAT Server_第5张图片

也可以查看会话表信息

[USG6000V1]dis firewall session table verbose

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

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

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

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

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

你可能感兴趣的:(网络技术,服务器,网络,华为)