华为防火墙配置目的nat

 路由器配置

#    //配置路由器接口地址
interface GigabitEthernet1/0/0
 ip address 1.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
 ip address 192.168.1.254 255.255.255.0
#
        防火墙的策略如下


#    //将接口加入安全域
firewall zone trust
 add interface GigabitEthernet1/0/1
#
firewall zone untrust
 add interface GigabitEthernet1/0/0
#


#   //配置安全策略
security-policy
 rule name to-int    //配置name为to-int的安全策略  作为内网用户访问外网的策略
  source-zone trust     
  destination-zone untrust
  source-address 192.168.1.0 mask 255.255.255.0
  action permit
 rule name to-web   //配置外网访问内网服务器的策略  使用外网地址和特定端口号就可以访问内网服务器
  source-zone untrust
  destination-zone trust
  destination-address 192.168.1.200 mask 255.255.255.255    //32位的内网服务器精确地址
  action permit
#

#        //配置nat地址组1
nat address-group 1 
 mode pat    //模式为NAPT模式即转换端口
 section 0 1.1.1.100   //设置地址池
#

#
nat-policy     //配置nat策略
 rule name to-internet   //作为NATP的策略
  source-zone trust
  destination-zone untrust
  source-address 192.168.1.0 mask 255.255.255.0
  action source-nat address-group 1
#

ip route-static 0.0.0.0 0.0.0.0 1.1.1.254      //指向路由的静态路由

#

 nat server 0 protocol tcp global 1.1.1.1 123 inside 192.168.1.200 80 no-reverse       //配置目的nat 外网地址为1.1.1.1也就是防火墙端口地址,访问1.1.1.1的123端口 映射到192.168.1.200的80端口,并且不产生反向nat会话表


接下来测试

选择server1 --配置根目录和端口号 启动服务

 

在client1 中进行测试

由于配置的目的nat地址为1.1.1.1端口号为123 则输入网址加端口号即可

如下图即为成功

 

  • 5
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

li工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值