1 / 25

Nat 技术

Nat 技术. 3. 3. NAT 基 础. 1. 3. NAT 的配置. 2. NAT 排错. NAT 限速. 4. Contents. 学习目标. 掌握静态 NAT 、动态 NAT 、 NAPT 的配置步骤 掌握三种 NAT 的不同应用 熟悉 NAT 的排错. Nat 的概念. NAT 英文全称是 Network Address Translation ,称为网络地址转换,它是 一个 IETF 标准,允许一个机构众多的用 户仅用少量的公网地址连接到 Internet 上。. 1. NAT 增加了延迟

ceri
Download Presentation

Nat 技术

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nat 技术

  2. 3 3 NAT 基 础 1 3 NAT 的配置 2 NAT 排错 NAT 限速 4 Contents

  3. 学习目标 • 掌握静态NAT、动态NAT、NAPT的配置步骤 • 掌握三种NAT的不同应用 • 熟悉NAT的排错

  4. Nat 的概念 NAT英文全称是Network Address Translation,称为网络地址转换,它是 一个IETF标准,允许一个机构众多的用 户仅用少量的公网地址连接到Internet上。

  5. . 1.NAT增加了延迟 2.NAT隐藏了端到端的地址,丢失了IP地址的跟踪,不能支持一些特定的应用程序 3.需要更多的资源如内存、CPU来处理NAT NAT的优缺点比较 1.局域网内保持私有IP,无需改变,只需改变路由器,做NAT转换,就可上外网 2.NAT节省了大量的地址空间 3.NAT隐藏了内部网络拓扑结构

  6. NAT 术语 l Inside local address –内部私有地址。指定给内部主机使用的地址,局域网内部地址,可为私有地址。 l Inside global address –内部公有地址。从ISP或NIC注册的地址,为合法的公网的地址。即内部主机地址被NAT转换的外部地址。 l Address Pool - NIC或ISP分配的多个公网地址。 l Outside local address – 外部网络中的内部主机地址,是另一个局域网的内部地址。 l Outside global address – 外部网络的公网地址

  7. 静态NAT 动态地址池 网络地址 端口转换 NAT的分类 • 动态地址NAT则是在外部网络中定义了一系列的合法地址,采用动态分配的方法映射到内部网络,多用于网络中的工作站的转换。 静态NAT设置起来最为简单和最容易实现的一种,内部网络中的每个主机都被永久映射成外部网络中的某个合法的地址,多用于服务器的永久映射。 • NAPT则是把内部地址映射到外部网络的一个IP地址的不同端口上。

  8. 静态NAT转换过程

  9. 动态地址池NAT转换过程

  10. 网络地址端口转换

  11. NAT的主要命令

  12. 1 2 3 1)定义内网接口和外网接口 2)建立静态的一对一的映射关系 3)设置默认路由 静态NAT的配置步骤

  13. 动态NAT的配置步骤 1 2 3 1)定义内网接口和外网接口 2)定义访问控制列表(内部本地地址范围) 4)建立映射关系 5)设置默认路由 3)定义转换的外网地址池(ISP提供的全局地址池) 2)

  14. 静态PAT配置步骤 1 2 3 1)定义内网接口和外网接口 3)设置默认路由 2)建立静态的映射关系

  15. 动态PAT配置步骤 1 2 3 1)定义内网接口和外网接口 2)定义内部本地地址范围 4)建立映射关系 5)设置默认路由 3)定义内部全局地址池

  16. 路由器R1的主要配置命令代码 R1(config)# int f1/0 R1(config-if)# ip add 192.168.1.1 255.255.255.0 R1(config-if)# ip nat inside R1(config-if)# no sh R1(config-if)# exi R1(config)# int s1/1 R1(config-if)# clock rate 64000 R1(config-if)# ip add 202.121.241.1 255.255.255.0 R1(config-if)# ip nat outside R1(config-if)# no sh R1(config-if)# exi R1(config)# ip nat inside source static 192.168.1.2 202.121.241.1 R1(config)# ip route 0.0.0.0 0.0.0.0 202.121.241.2

  17. (2) 路由器R2的主要配置命令代码: R2(config)# int s1/1 R2(config-if)# ip add 202.121.241.2 255.255.255.0 R2(config-if)# no sh R2(config-if)# exi R2(config)# int loopback 0 R2(config-if)# ip add 219.220.234.1 255.255.255.0 R2(config-if)# no sh R2(config-if)# exit

  18. 园区网中的NAT综合配置

  19. 1.在三层交换机SW1及SW2上进行以下配置。以SW1为例,SW2类似(这里省略)1.在三层交换机SW1及SW2上进行以下配置。以SW1为例,SW2类似(这里省略) 1)定义每个VLAN 1、2、3、7、8、9,给出SVI; Sw1(config)# int f0/1 Sw1(config-if)# switch mode access Sw1(config-if)# switch access vlan 2 Sw1(config-if)# no sh Sw1(config-if)# int f0/2 Sw1(config-if)# switch mode access Sw1(config-if)# switch access vlan 3 Sw1(config-if)# no sh Sw1(config-if)# int f0/5 Sw1(config-if)# switch mode access Sw1(config-if)# switch access vlan 1 Sw1(config-if)# no sh Sw1(config-if)# exi Sw1(config)# int range f0/3 - 4 Sw1(config-if-range)# channel-g 1 m o Sw1(config-if-range)# exi Sw1(config)# int vlan 2 Sw1(config-if)# ip add 192.168.2.1 255.255.255.0 Sw1(config-if)# no sh Sw1(config-if)# int vlan 3 Sw1(config-if)# ip add 192.168.3.1 255.255.255.0 Sw1(config-if)# no sh Sw1(config-if)# int vlan 1 Sw1(config-if)# ip add 192.168.0.2 255.255.255.0 Sw1(config-if)# no sh

  20. 2)定义三层聚合口,给出IP地址 Sw1# conf t Enter configuration commands, one per line. End with CNTL/Z. Sw1(config)# int range f0/3 - 4 Sw1(config-if-range)# channel-group 1 mode on /*此命令是思科官方交换路由模拟器PacketTracer中的聚合命令,相当于锐捷中的port-group 1 Sw1(config-if-range)# no switch Sw1(config)# int port-channel 1 /*此命令是思科官方交换路由模拟器PacketTracer中的进入聚合口配置模式,相当于锐捷中的int aggr 1 Sw1(config-if)# no switchport Sw1(config-if)# ip add 192.168.10.1 255.255.255.0 Sw1(config-if)# exi

  21. 3)指定一条默认路由到路由器R1的接口; Sw1(config)# ip route 0.0.0.0 0.0.0.0 192.168.0.1 4)启动OSPF,宣告各个VLAN网络及聚合口对 应的网络,注意各个不同的区域: Sw1(config)# router ospf 100 Sw1(config-router)# net 192.168.2.0 0.0.0.255 area 2 Sw1(config-router)# net 192.168.3.0 0.0.0.255 area 3 Sw1(config-router)# net 192.168.0.0 0.0.0.255 area 0 Sw1(config-router)# net 192.168.10.0 0.0.0.255 a rea 0 Sw1(config-router)# exi

  22. 2.对R1进行以下配置 2)启动OSPF,宣告内网接口的每个网络,为area 0 R1(config)# router ospf 100 R1(config-router)# net 192.168.0.0 0.0.0.255 area 0 R1(config-router)# net 192.168.7.0 0.0.0.255 area 0 R1(config-router)# net 192.168.7.0 0.0.0.255 area 0 R1(config-router)# exi Router# 1)定义接口 R1>en R1# conf t R1(config)# int f1/0 R1(config-if)# ip add 192.168.0.1 255.255.255.0 R1(config-if)# no sh R1(config-if)# int f1/1 R1(config-if)# ip add 192.168.7.1 255.255.255.0 R1(config-if)# no sh R1(config-if)# int s1/0 R1(config-if)# clock rate 64000 R1(config-if)# ip add 202.121.241.1 255.255.255.252 R1(config-if)# no sh 3)指定默认路由 R1(config)# ip rout 0.0.0.0 0.0.0.0 202.121.241.2 R1(config)# router ospf 100 R1(config-router)# redi stat sub R1(config-router)# redi stat subnets R1(config-router)# exi R1(config)#

  23. 清除条目 R1# show ip nat translation Pro Inside global Inside local Outsids local Outside global tcp 192.168.2.1:11003 10.1.1.1:11003 172.16.2.2:23 172.16.2.2:23 tcp 192.168.2.1:1067 10.1.1.1:1067 172.16.2.2:23 172.16.2.2:23 R1# R1# clear ip nat translation * R1# show ip nat translation R1# <nothing> 查看统计信息 pro inside global inside local outside local outside global tcp 192.168.2.1:11003 10.1.1.1:11003 172.16.2.2:23 172.16.2.2:23 tcp 192.168.2.1:1067 10.0.1.1.1:1067 172.16.2.3:23 172.16.2.3:23 显示当前的转换 R1# show ip nat translations ror inside ip nat translations pro inside global inside local outside local outside global --- 192.2.2.1 10.1.1.1 --- --- --- 192.2.2.1 10.1.1.2 --- --- NAT排错

  24. Thank You !

More Related