|
|
@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
<h1><center>AAA认证技术&NAT技术</h1></center>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
> 作者:行癫
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>第一节:AAA认证技术</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>一:AAA概述</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.AAA基本概念</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA是Authentication(认证)、Authorization(授权)和Accounting(计费)的简称,是网络安全的一种管理机制,提供了认证、授权、计费三种安全功能
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215094348143.png" alt="image-20220215094348143" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
认证(Authentication):验证用户是否可以获得访问权,确定哪些用户可以访问网络
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
授权(Authorization):授权用户可以使用哪些服务
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
计费(Accounting):记录用户使用网络资源的情况
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
网络运营商(ISP)需要验证家庭宽带用户的账号密码之后才允许其上网,并记录用户的上网时长或上网流量等内容,这就是AAA技术最常见的应用场景
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.AAA常见架构</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA常见网络架构中包括用户、NAS(Network Access Server)、AAA服务器(AAA Server)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215094640836.png" alt="image-20220215094640836" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NAS基于域来对用户进行管理,每个域都可以配置不同的认证、授权和计费方案,用于对该域下的用户进行认证、授权和计费
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
每个用户都属于某一个域。用户属于哪个域是由用户名中的域名分隔符@后的字符串决定。例如,如果用户名是user1@domain1,则用户属于domain1域。如果用户名后不带有@,则用户属于系统缺省域
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.认证</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA支持的认证方式有:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
不认证
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
本地认证
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
远端认证
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215094750164.png" alt="image-20220215094750164" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
不认证:完全信任用户,不对用户身份进行合法性检查。鉴于安全考虑,这种认证方式很少被采用
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
本地认证:将本地用户信息(包括用户名、密码和各种属性)配置在NAS上,此时NAS就是AAA Server。本地认证的优点是处理速度快、运营成本低;缺点是存储信息量受设备硬件条件限制。这种认证方式常用于对用户登录设备进行管理,如Telnet,FTP用户等
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
远端认证:将用户信息(包括用户名、密码和各种属性)配置在认证服务器上。支持通过RADIUS协议或HWTACACS协议进行远端认证。NAS作为客户端,与RADIUS服务器或HWTACACS服务器进行通信
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>4.授权</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA支持的授权方式有:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
不授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
本地授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
远端授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
授权信息包括:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
所属用户组
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
所属VLAN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ACL编号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215095019940.png" alt="image-20220215095019940" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
不授权:不对用户进行授权处理
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
本地授权:根据NAS上对应域下的配置进行授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
远端授权:支持由RADIUS服务器授权或HWTACACS服务器授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HWTACACS授权,使用HWTACACS服务器对所有用户授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS授权,只支持对通过RADIUS服务器认证的用户授权。RADIUS协议的认证和授权是绑定在一起的,不能单独使用RADIUS进行授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
注意:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
当采用远端授权时,用户可以同时从授权服务器和NAS获取授权信息。NAS配置的授权信息优先级比授权服务器下发的授权信息低
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>5.计费</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
计费功能用于监控授权用户的网络行为和网络资源的使用情况
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA支持的计费方式有:不计费、远端计费
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215095434446.png" alt="image-20220215095434446" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
不计费:为用户提供免费上网服务,不产生相关活动日志
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
远端计费:支持通过RADIUS服务器或HWTACACS服务器进行远端计费
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>6.AAA实现协议-RADIUS</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100020474.png" alt="image-20220215100020474" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA可以用多种协议来实现,最常用的是RADIUS协议。RADIUS是一种分布式的、客户端/服务器结构的信息交互协议,可以实现对用户的认证、计费和授权功能
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
通常由NAS作为RADIUS客户端,负责传输用户信息到指定的RADIUS服务器,然后根据从服务器返回的信息进行相应处理(如接受/拒绝用户接入)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS服务器一般运行在中心计算机或工作站上,维护相关的用户认证和网络服务访问信息,负责接收用户连接请求并认证用户,然后给客户端返回所有需要的信息(如接受/拒绝认证请求)。RADIUS使用UDP(User Datagram Protocol)作为传输协议,并规定UDP端 口1812、1813分别作为认证、计费端口,具有良好的实时性;同时也支持重传机制和备用服务器机制,从而具有较好的可靠性
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**RADIUS客户端与服务器间的消息流程如下:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
当用户接入网络时,用户发起连接请求,向RADIUS客户端(即NAS)发送用户名和密码
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS客户端向RADIUS服务器发送包含用户名和密码信息的认证请求报文
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS服务器接收到合法的请求后,完成认证,并把所需的用户授权信息返回给客户端;对于非法的请求,RADIUS服务器返回认证失败的信息给客户端
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS客户端通知用户认证是否成功
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS客户端根据接收到的认证结果接入/拒绝用户。如果允许用户接入,则RADIUS客户端向RADIUS服务器发送计费开始请求报文
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS服务器返回计费开始响应报文,并开始计费
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
用户开始访问网络资源
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
当用户不再想要访问网络资源时,用户发起下线请求,请求停止访问网络资源
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS客户端向RADIUS服务器提交计费结束请求报文
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS服务器返回计费结束响应报文,并停止计费
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RADIUS客户端通知用户访问结束,用户结束访问网络资源
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>7.AAA应用场景</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100228936.png" alt="image-20220215100228936" style="zoom:67%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>二:AAA配置实现</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215100255416](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100255416.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**authorization-scheme** *authorization-scheme-name*命令用来配置域的授权方案。缺省情况下,域下没有绑定授权方案
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**authentication-mode** { **hwtacacs** | **local** | **radius** }命令用来配置当前认证方案使用的认证方式。缺省情况下,认证模式为本地认证方式
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215100335073](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100335073.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215100343597](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100343597.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.AAA配置案例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
在设备R1上配置用户密码和级别,使主机A可以通过配置的用户名和密码远程登录到设备
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100455438.png" alt="image-20220215100455438" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**配置验证**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AAA中,每个域都会与相应的认证授权和计费方案相关联,当前为默认域
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100600237.png" alt="image-20220215100600237" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**display domain** [ **name** *domain-name* ]命令用来查看域的配置信息
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Domain-state**为Active表示激活状态
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**如果用户名后不带有@,则用户属于系统缺省域,华为设备支持两种缺省域:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default域为普通用户的缺省域
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default_admin域为管理用户的缺省域
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**用户正常登录并且下线之后可以看到用户的记录信息**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215100714547.png" alt="image-20220215100714547" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**display aaa offline-record**命令用来查看系统中用户下线的记录
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>第二节:网络地址转换</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>一:NAT概述</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.NAT产生背景</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
随着互联网用户的增多,IPv4的公有地址资源显得越发匮乏
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
同时IPv4公有地址资源存在地址分配不均的问题,这导致部分地区的IPv4可用公有地址严重不足
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
为解决问题,使用过渡技术解决IPv4公有地址短缺就显得尤为重要
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.私有IP地址</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
公有地址:由专门机构管理、分配,可以在Internet上直接通信的IP地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
私有地址:组织和个人可以任意使用,无法在Internet上直接通信,只能在内网使用的IP地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A、B、C类地址中各预留了一些专门作为私有IP地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A类:10.0.0.0~10.255.255.255
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
B类:172.16.0.0~172.31.255.255
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C类:192.168.0.0~192.168.255.255
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.NAT技术原理</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NAT:对IP数据报文中的IP地址进行转换,是一种在现网中被广泛部署的技术,一般部署在网络出口设备,例如防火墙或路由器上
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
通过私有地址的使用结合NAT技术,可以有效节约公网IP地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115034484.png" alt="image-20220215115034484" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
由于私有地址无法在Internet上路由转发,访问Internet的IP数据包将缺乏路由无法到达私有网络出口设备
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
如果使用了私有地址的私有网络需要访问Internet,必须在网络出口设备配置NAT,将访问Internet的IP数据报文中的私有网络源地址转换成公有网络源地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>二:静态NAT</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.静态NAT技术原理</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**静态NAT**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
每个私有地址都有一个与之对应并且固定的公有地址,即私有地址和公有地址之间的关系是一对映射
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**支持双向互访**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
私有地址访问Internet经过出口设备NAT转换时,会被转换成对应的公有地址,同时,外部网络访问内部网络时,其报文携带的公有地址也会被NAT设备转换成对应的私有地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115423428.png" alt="image-20220215115423428" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.静态NAT转换示例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115501948.png" alt="image-20220215115501948" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.静态NAT配置</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215115530319](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115530319.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**案例**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115552355.png" alt="image-20220215115552355" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215115615489.png" alt="image-20220215115615489" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>三:动态NAT</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.动态NAT技术原理</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**动态NAT**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
静态NAT严格的一对一进行地址转换,这就导致即便内网主机长时间离线或者不发送数据时,与之前对应的公有地址也处于使用状态,为了避免地址浪费,动态提出了地址池的概念,所有的地址池组成地址池
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
当内部主机访问外部网络时临时分配一个地址池中未使用的IP地址,并将该地址标记为”In Use”,当该主机不在访问外部网络时回收分配的地址,重新标记为“Not Use”
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121539297.png" alt="image-20220215121539297" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.动态地址池示例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121607776.png" alt="image-20220215121607776" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121649308.png" alt="image-20220215121649308" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.动态地址池配置</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215121719552](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121719552.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>4.动态地址池配置实验</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121749370.png" alt="image-20220215121749370" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215121757426.png" alt="image-20220215121757426" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>四:NAPT、Easy-IP</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.NAPT技术原理</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
动态NAT选择地址池中的地址进行地址转换时不会转换端口号,即No-PAT,非端口地址转换,公有地址与私有地址还是1:1的映射关系,无法提高公有地址的利用率
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NAPT(网络地址端口转换):从地址此中选择地址进行地址转换时不仅转换IP地址,同时也会对端口号进行转换,从而实现公有地址与私有地址1:n映射,可以有效提高公有地址的利用率
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215125316458.png" alt="image-20220215125316458" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NAPT借助端口可以实现一个公有地址同时对应多个私有地址。该模式同时对IP地址和传输层端口进行转换,实现不同私有地址(不同的私有地址,不同的源端口)映射到同一个公有地址(相同的公有地址,不同的源端口)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.NAPT转换示例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215125351170.png" alt="image-20220215125351170" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215125404605.png" alt="image-20220215125404605" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.NAPT配置实验</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215125456150.png" alt="image-20220215125456150" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215125445935.png" alt="image-20220215125445935" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>4.Easy-IP</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
实现原理和NAT相同,同时转换IP地址、传输层端口,区别在于Easy-IP没有地址池的概念,使用接口地址作为NAT转换的公有地址
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
适用于不具备固定公网IP地址的场景,如通过DHCP、PPPoE拨号获取地址的私有网络出口,可以直接使用获取到的动态地址进行转换
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215193345597.png" alt="image-20220215193345597" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DHCP:Dynamic Host Configuration Protocol ,动态主机配置协议
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PPPoE:Point-to-Point Protocol over Ethernet ,以太网承载PPP协议
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>5.Easy-IP配置</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20220215193502013](%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215193502013.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>五:NAT Server</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>1.NAT Server应用场景</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
指定【公有地址:端口】与【私有地址:端口】的一对一映射关系,将内网服务器映射到公网,当私有网络中的服务器需要对公网提供服务时使用
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
外网主机主动访问【公有地址:端口】实现对内网服务器的访问
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215193809951.png" alt="image-20220215193809951" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>2.NAT Server转换实例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215193838988.png" alt="image-20220215193838988" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>3.NAT Server配置示例</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="%E7%AC%AC%E4%B8%83%E7%AB%A0%EF%BC%9AAAA%E8%AE%A4%E8%AF%81%E6%8A%80%E6%9C%AF&NAT%E6%8A%80%E6%9C%AF.assets/image-20220215193919015.png" alt="image-20220215193919015" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|