NAT网络地址转换技术(三)在防火墙上配置源NAT和NAT Server
文章目录实验要求实验步骤一二三四实验要求实验步骤一搭建拓扑,合理规划网段并配置终端以及防火墙接口IP地址。终端IP地址省略。防火墙各个接口IP地址:[USG6000V1]int g1/0/0[USG6000V1-GigabitEthernet1/0/0]ip ad 192.168.1.254 24[USG6000V1]int g1/0/1[USG6000V1-GigabitEt...
·
实验要求

实验步骤
一
搭建拓扑,合理规划网段并配置终端以及防火墙接口IP地址。终端IP地址省略。
防火墙各个接口IP地址:
[USG6000V1]int g1/0/0
[USG6000V1-GigabitEthernet1/0/0]ip ad 192.168.1.254 24
[USG6000V1]int g1/0/1
[USG6000V1-GigabitEthernet1/0/1]ip ad 202.196.1.254 24
[USG6000V1-GigabitEthernet1/0/1]int g1/0/2
[USG6000V1-GigabitEthernet1/0/2]ip ad 10.0.0.254 24
二
配置防火墙安全区域以及安全策略。
安全区域和策略具体配置以及解释请查看文章:防火墙详解(三)华为防火墙基础安全策略配置(命令行配置)
区域配置命令:
[USG6000V1]firewall zone trust
[USG6000V1-zone-trust]add interface g1/0/0
[USG6000V1]firewall zone untrust
[USG6000V1-zone-untrust]add interface g1/0/1
[USG6000V1]firewall zone dmz
[USG6000V1-zone-dmz]a i g1/0/2
可以通过display zone 查看安全区域具体配置情况
安全策略配置:
[USG6000V1]security-policy
[USG6000V1-policy-security]rule name t2u
[USG6000V1-policy-security-rule-t2u]source-zone trust
[USG6000V1-policy-security-rule-t2u]destination-zone untrust
[USG6000V1-policy-security-rule-t2u]destination-zone dmz
[USG6000V1-policy-security-rule-t2u]action permit
[USG6000V1-policy-security-rule-t2u]q
[USG6000V1-policy-security]rule name u2d
[USG6000V1-policy-security-rule-u2d]source-zone untrust
[USG6000V1-policy-security-rule-u2d]destination-zone dmz
[USG6000V1-policy-security-rule-u2d]action permit
可以通过display security-policy all查看全部的安全策略,也可以通过display security-policy rule [name] 查看具体规则
三
配置源NAT
命令:
[USG6000V1]nat address-group nat1 //创建NAT地址池
[USG6000V1-address-group-nat1]mode ? //源NAT模式选择
full-cone Indicate the Fullone mode
no-pat Indicate the NOPAT mode //不使用端口号
pat Indicate the Pat mode //使用端口号(NAPT)
pcp Indicate the PCP mode //
[USG6000V1-address-group-nat1]mode pat //选择Pat模式
[USG6000V1-address-group-nat1]section 202.196.1.2 202.196.1.10 //设置地址池范围
[USG6000V1-address-group-nat1]q
[USG6000V1]nat-policy //设置NAT策略
[USG6000V1-policy-nat]rule name nat1 //创建名字
[USG6000V1-policy-nat-rule-nat1]source-zone trust //源区域
[USG6000V1-policy-nat-rule-nat1]destination-zone untrust //目的区域
[USG6000V1-policy-nat-rule-nat1]source-address 192.168.1.0 mask 255.255.255.0 //源地址
[USG6000V1-policy-nat-rule-nat1]action nat address-group nat1 //设置规则,当匹配上述条件则在nat1地址池中选择地址
验证:
分别在防火墙G1/0/0和G1/0/1抓包,并内网ping外网,查看地址是否变化。
四
配置NAT Server:
[USG6000V1]nat server server1 protocol icmp global 202.196.1.88 inside 10.0.0.1
no-reverse //配置NAT Server 名称为Server1 协议为IMCP,将10.0.0.1 转换成202.196.1.88
在这里插入代码片
验证:
注意,ping 202.196.1.88

更多推荐

所有评论(0)