37 公私网转换技术-NAT基础

一  静态NAT 1对1转换

配置命令

测试结果

删除静态NAT        


[R1-BJ-GigabitEthernet0/2]undo nat  static  enable 
[R1-BJ-GigabitEthernet0/2]dis
#
interface GigabitEthernet0/2
 port link-mode route
 combo enable copper
 ip address 100.1.1.1 255.255.255.248
#
return
[R1-BJ]display  this 
#
 sysname R1-BJ
#
 nat static outbound 10.110.10.8 100.1.1.3
 nat static outbound 10.110.10.9 100.1.1.4
#
 system-working-mode standard
 xbar load-single
 password-recovery enable
 lpu-type f-series
#
 scheduler logfile size 16
#
 ip route-static 192.168.56.0 24 100.1.1.2
#
 domain default enable system
#
return
[R1-BJ]un
[R1-BJ]undo   nat static outbound 10.110.10.8 100.1.1.3
[R1-BJ]un
[R1-BJ]undo   nat static outbound 10.110.10.9 100.1.1.4
[R1-BJ]dis
[R1-BJ]display  th
[R1-BJ]display  this 
#
 sysname R1-BJ
#
 system-working-mode standard
 xbar load-single
 password-recovery enable
 lpu-type f-series
#
 scheduler logfile size 16
#
 ip route-static 192.168.56.0 24 100.1.1.2
#
 domain default enable system
#
return
[R1-BJ]

华为

nat static global 100.1.1.6 inside 192.168.1.1 netmask 255.255.255.255

二 NAT地址池

华为操作

地址池动态NAT 华三

三 内网用户通过NAT访问外网(地址重叠)公网只有 100.1.1.3 100.1.1.4

第二步 建立重复的地址

第三步 调用规则

 ip address 100.1.1.1 255.255.255.248
 nat inbound 2004 address-group 2 no-pat reversible
 nat outbound 2004 address-group 4

四 服务器映射

 ip address 182.96.17.171 255.255.255.0 sub
 ip address 182.96.17.177 255.255.255.0 sub
 nat outbound 2000

nat server protocol tcp global 182.96.17.170 8888 inside 192.168.160.50 8888 rule ServerRule_402
 nat server protocol tcp global 182.96.17.170 9999 inside 192.168.160.52 9999 rule ServerRule_403
 nat server protocol tcp global 182.96.17.171 81 inside 172.17.1.13 81 rule ServerRule_400
 nat server protocol tcp global 182.96.17.172 12081 inside 192.168.160.81 11022 rule ServerRule_223

[R1-BJ-GigabitEthernet0/2] nat inbound 2004 address-group 2  ?
  counting      NAT counting statistics
  description   Descrption the configuration
  disable       The NAT configuration change to disable status
  no-pat        Disable Port Address Translation (PAT)
  priority      Specify a NAT priority
  rule          Specify a NAT rule
  vpn-instance  Specify a VPN instance
  <cr>         

  • nat inbound 2004: 这可能是一个命令,用于指定NAT的内部接口或流量方向。2004可能是一个标识符或特定的配置参数。
  • address-group 2: 这可能是将流量与地址组2关联的命令,地址组可能包含了一系列IP地址或地址范围。
  • counting: 这可能是一个选项,用于启用NAT统计信息的计数。
  • description: 这可能是一个命令,用于添加或修改NAT配置的描述。
  • disable: 这可能是一个命令,用于禁用当前的NAT配置。
  • no-pat: 这可能是一个命令,用于禁用端口地址转换(PAT),PAT是NAT的一种形式,允许多个设备共享单个公网IP地址。
  • priority: 这可能是一个命令,用于指定NAT配置的优先级。
  • rule: 这可能是一个命令,用于指定或修改NAT规则。
  • vpn-instance: 这可能是一个命令,用于指定NAT配置与特定的VPN实例关联。

  • 8
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

人生的方向随自己而走

世界上没有免费的午餐

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

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

打赏作者

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

抵扣说明:

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

余额充值