云计算百科
云计算领域专业知识百科平台

【华为ensp防火墙】双机热备+NAT+外网访问内部服务器(http、ftp)

防火墙理论:

1、路由、透明、混合 2、区域:Local、Trust、Dmz、Untrust 3、安全策略,区域操作,IP    条件、操作、配置文件(根据现今情况,另外的安全产品替代)    NAT策略:源地址、目的地址、双向             静态、动态、NAPT、Easy-IP             Nat Server

双机热备+NAT+外网访问内部服务器实验要求:

1、PC1、Server 模拟内网设备,位于防火墙的Trust区域; 2、Client1模拟Internet,位于防火墙的Untrust区域; 3、防火墙部署双机热备,工作方式为主备,正常情况下FW1为主,FW2为备; 4、要求PC1能够访问位于外网的PC2,并且访问时需进行NAT源地址转换, 使用的地址池区间是200.1.1.10至200.1.1.20;PC2能够以200.1.1.29为目的地址访问Server的FTP服务 5、要求Client1访问DMZ区域Server3 HTTP服务,以200.1.1.100为目的地址

以下是拓扑图:

基础配置:

FW1

sys

sysname FW1

undo info en

#VRRP配置,针对trust

int g1/0/0

ip add 192.168.1.253 24

vrrp vrid 1 virtual-ip 192.168.1.254 24 active

q

#VRRP配置,针对untrust

int g1/0/5

ip add 200.1.1.3 24

vrrp vrid 3 virtual-ip 200.1.1.1 24 active

q

int g1/0/6

ip add 1.1.1.1 24

#防火墙双机热备,新建区域ha

firewall zone name ha

set priority 99

add interface g 1/0/6

q

firewall zone trust

add interface g 1/0/0

q

firewall zone untrust

add interface g 1/0/5

q

FW2:

sys

sysname FW2

undo info en

#VRRP配置,针对trust

int g1/0/0

ip add 192.168.1.252 24

vrrp vrid 1 virtual-ip 192.168.1.254 24 active

q

#VRRP配置,针对untrust

int g1/0/5

ip add 200.1.1.2 24

vrrp vrid 3 virtual-ip 200.1.1.1 24 active【active是抢占式,这里也可以设置standy】

q

int g1/0/6

ip add 1.1.1.2 24

hrp int g1/0/6 remote 1.1.1.2

hrp enable

我这是FW1是主(M),FW2是备(S

【如果你的主备机和我的不一样,则是因为前面我们前面设置vrrp的时候,vrid1vrid3都设置的active,这是抢占式,如果你的FW2是主,不用担心,这只是因为你的FW2先抢到了主而已】

此时disable界面是因为另一端没有进行双机热备,此时我们去另一端进行配置

hrp int g1/0/6 remote 1.1.1.1

hrp enable

dis hrp state查看情况             

FW1

security-policy(只能在主上执行,备上不行)

rule name TtoU

source-zone trust

source-address 192.168.1.0 24

destination-zone untrust

action permit

int g1/0/0

service-manage ping permit(没开之前不允许)

现在尝试用PC1ping网关(192.168.1.254)看看

PC1 ping Client(200.1.1.30)试试

发现ping不通,到g1/0/5开启权限

int g1/0/5

service-manage ping permit

现在我们尝试一下主备切换

原本FW1是主(M),FW2是备(S)–【如果你的主备机和我的不一样,则是因为前面我们前面设置vrrp的时候,vrid1vrid3都设置的active,这是抢占式,如果你的FW2是主,不用担心,这只是因为你的FW2先抢到了主而已】

现在我们将FW1变成S(备),FW2变成M(主)

现在再看FW1和FW2

undo shutdown就可以开启g1/0/5,取消主备切换

FTP配置:

NAT源地址转换 先配置源地址池

nat address-group 1

section 200.1.1.10 200.1.1.20  #地址区间

q

nat-policy

rule name TtoU

source-zone trust

source-address 192.168.1.0 24

destination-zone untrust

action source-nat address-group 1

q

nat server zone untrust protocol tcp global 200.1.1.29 21 inside 192.168.1.100 21

firewall zone untrust

detect ftp

security-policy

rule name toFTP

source-zone untrust

destination-zone trust

destination-address 192.168.1.100 32

action permit

q

然后我们打开server1的ftp服务,使用Client进行登录,以下是登录成功的页面

HTP配置:

FW1:

int g 1/0/1

ip add 172.168.1.253 24

vrrp vrid 5 virtual-ip 172.168.1.254 24 active

FW2:

int g 1/0/1

ip add 172.168.1.252 24

vrrp vrid 5 virtual-ip 172.168.1.254 24  active  standby

FW1:

firewall zone name dmz

add interface g 1/0/1

q

#NAT策略

nat-policy

rule name DtoU

source-zone dmz

source-address 172.168.1.0 24

destination-zone untrust

action source-nat address-group 1

#NAT Server配置HTTP服务

#HHTP服务,数据接口80

#意味着需要开放端口,NAT Server开放了80口,通过untrust区域转发,开放了80口

nat server zone untrust protocol tcp global 200.1.1.100 80 inside 172.168.1.20 80

firewall zone untrust

detect httpd

q

#配置安全策略,允许访问HTTP服务器

security-policy

rule name tohttp

source-zone untrust

destination-zone dmz

destination-address 172.168.1.20 32

action permit

int g0/0/0

service-manage all permit

然后现在就可以测试了

打开server2的http服务,然后用Client进行访问,看看是否成功

如果对您有帮助麻烦点个关注点个赞~~~  

赞(0)
未经允许不得转载:网硕互联帮助中心 » 【华为ensp防火墙】双机热备+NAT+外网访问内部服务器(http、ftp)
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!