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实例关联。

相关推荐

  1. NAT路由器,将内ip转换为外ip

    2024-07-14 23:18:04       53 阅读
  2. 38 IRF+链路聚合+ACL+NAT架构

    2024-07-14 23:18:04       21 阅读
  3. <span style='color:red;'>NAT</span><span style='color:red;'>技术</span>

    NAT技术

    2024-07-14 23:18:04      38 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 23:18:04       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 23:18:04       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 23:18:04       57 阅读
  4. Python语言-面向对象

    2024-07-14 23:18:04       68 阅读

热门阅读

  1. R语言简单介绍及零基础学习路径

    2024-07-14 23:18:04       19 阅读
  2. 在unity中的球形插值方法中第三个参数t是什么

    2024-07-14 23:18:04       17 阅读
  3. linux安装pure-ftpd-1.0.51

    2024-07-14 23:18:04       17 阅读
  4. Linux 编程中的 open() 与 fdopen() 区别与联系

    2024-07-14 23:18:04       19 阅读
  5. iPython 使用技巧

    2024-07-14 23:18:04       16 阅读
  6. C基础入门题:石头剪刀布

    2024-07-14 23:18:04       21 阅读
  7. Linux C++编程-实现进程的冻结与恢复管理模块

    2024-07-14 23:18:04       17 阅读