




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
NAT(Network
Address
Translation)网络地址转换NAT-网络地址转换An
IP
address
is
either
local
or
global.Local
IPv4
addresses
are
seen
in
the
inside
network.Global
IPv4
addresses
are
seen
in
the
outside
network.NAT地址转换的具体过程NAT术语内部本地转换之前内部源地址的名字外部本地转换之前目标主机的名字内部全局转换之后内部主机的名字外部全局转换之后外部目标主机的名字内部本地Internet内部全局外部全局外部本地insideoutsideoutsideinsideNAT三种类型1
静态NAT将内部本地地址与内部全局地址进行一对一的明确转换。这种方法主要用在内部网络中有对外提供服务的服务器,如WEB、MAIL服务器时。该方法的缺点是需要独占宝贵的合法IP地址。即,如果某个合法IP地址已经被NAT静态地址转换定义,即使该地址当前没有被使用,也不能被用作其它的地址转换。Establishes
static
translation
between
an
inside
local
address
and
aninside
global
addressRouter(config)#
ip
nat
inside
source
static
local-ip
global-ipMarks
the
interface
as
connected
to
the
insideRouter(config-if)#
ip
nat
insideMarks
the
interface
as
connected
to
the
outsideRouter(config-if)#
ip
nat
outsideDisplays
active
translationsRouter#
show
ip
nat
translations配置静态NAT转换配置静态NAT转换-举例Router#
show
ip
nat
translationsPro
Inside
global---192.168.1.2Inside
local10.1.1.2Outside
local---Outside
global---interface
s0ip
address
192.168.1.1
255.255.255.0ip
nat
outside!interface
e0ip
address
10.1.1.1
255.255.255.0ip
nat
inside!ip
nat
inside
source
static
10.1.1.2
192.168.1.2NAT三种类型2
动态NAT动态地址转换也是将内部本地地址与内部全局地址进行一对一的转换。但是,是从内部全局地址池中动态地选择一个未使用的地址对内部本地地址进行转换。该地址是由未被使用的地址组成的地址池中在定义时排在最前面的一个。当数据传输完毕后,路由器将把使用完的内部全局地址放回到地址池中,以供其它内部本地地址进行转换。但是在该地址被使用时,不能用该地址再进行一次转换。Establishes
dynamic
source
translation,
specifying
the
ACL
that
wasdefined
in
the
previous
stepRouter(config)#
ip
nat
inside
source
listaccess-list-number
pool
nameDefines
a
pool
of
global
addresses
to
be
allocated
as
neededRouter(config)#
ip
nat
pool
name
start-ip
end-ip{netmasknetmask
|
prefix-length
prefix-length}Defines
a
standard
IP
ACL
permitting
those
inside
local
addressesthat
are
to
be
translatedRouter(config)#
access-list
access-list-number
permitsource
[source-wildcard]Displays
active
translationsRouter#
show
ip
nat
translations配置动态NAT转换配置动态NAT转换-举例Router#
show
ip
nat
translations
Pro
Inside
global Inside
localOutside
localOutside
global---171.69.233.209192.168.1.100---------171.69.233.210192.168.1.101------NAT三种类型3端口复用复用地址转换也称为端口地址转换(Port
Address
Translation,PAT),首先是一种动态地址转换。路由器将通过记录地址、应用程序端口等唯一标识一个转换。通过这种转换,可以使多个内部本地地址同时与同一个内部全局地址进行转换并对外部网络进行访问。对于只申请到少量IP地址甚至只有一个合法IP地址,却经常有很多用户同时要求上网的情况,这种转换方式非常有用理想状况下,一个单一的IP地址可以使用的端口数为4000个理解PAT地址转换(Overloading)配置PAT地址转换(Overloading)Establishes
dynamic
source
translation,
specifying
the
ACL
that
wasdefined
in
the
previous
stepRouter(config)#
ip
nat
inside
source
listaccess-list-number
interface
interface
overloadDefines
a
standard
IP
ACL
that
will
permit
the
inside
local
addressesthat
are
to
be
translatedRouter(config)#
access-list
access-list-number
permitsource
source-wildcardDisplays
active
translationsRouter#
show
ip
nat
translations配置PAT地址转换(Overloading)-举例Router#
show
ip
nat
translationsPro
Inside
global Inside
localTCP172.17.38.1:1050
192.168.3.7:1050TCP172.17.38.1:1776
192.168.4.12:1776Outside
local10.1.1.1:2310.2.2.2:25Outside
global10.1.1.1:2310.2.2.2:25hostname
Router!interface
Ethernet0ip
address
192.168.3.1
255.255.255.0ip
natinside!interface
Ethernet1ip
address
192.168.4.1
255.255.255.0ip
natinside!interface
Serial0description
To
ISPip
address
172.17.38.1
255.255.255.0ip
natoutside!ip
nat
inside
source
list
1
interface
Serial0
overload!ip
route
0.0.0.0
0.0.0.0
Serial0!access-list
1
permit
192.168.3.0
0.0.0.255access-list
1
permit
192.168.4.0
0.0.0.255!Clears
a
simple
dynamic
translation
entry
that
contains
an
insidetranslation
or
both
an
inside
and
outside
translationRouter#
clear
ip
nat
translation
inside
global-iplocal-ip
[outside
local-ip
global-ip]Clears
all
dynamic
address
translation
entriesRouter#
clear
ip
nat
translation
*Clears
a
simple
dynamic
translation
entry
that
contains
an
outsidetranslationRouter#
clear
ip
nat
translation
outsidelocal-ip
global-ipClears
an
extended
dynamic
translation
entry
(PAT
entry)Router#
clear
ip
nat
translation
protocol
inside
global-ipglobal-port
local-ip
local-port
[outside
local-iplocal-port
global-ip
global-port]清除NAT
转换表项问题:在NAT表中没有转换项Verify
that:–There
are
no
inbound
ACLs
thatare
denyingthepacketsentry
to
the
NATrouter–The
ACL
referenced
by
the
NAT
command
is
permittingallnecessary
networks–There
are
enough
addresses
in
the
NAT
pool–The
router
interfaces
are
appropriately
defined
as
NATinside
or
NAToutsideRouter#
show
ip
nat
statisticsTotal
active
translations:
1
(1
static,
0
dynamic;
0
extended)Outside
interfaces:Ethernet0,
Serial2Inside
interfaces:Ethernet1Hits:
5 Misses:
0…显示相关的转换信息:debug
and
show
命令Router#
debug
ip
natNAT:
s=192.168.1.95->172.31.233.209,
d=172.31.2.132
[6825]NAT:
s=172.31.2.132,
d=172.31.233.209->192.168.1.95
[21852]NAT:
s=192.168.1.95->172.31.233.209,
d=172.31.1.161
[6826]NAT*:
s=172.31.1.161,
d=172.31.233.209->192.168.1.95
[23311]NAT*:
s=192.168.1.95->172.31.233.209,
d=172.31.1.161
[6827]NAT*:
s=192.168.1.95->172.31.233.209,
d=172.31.1.161
[6828]NAT*:
s=172.31.1.161,
d=172.31.233.209->192.168.1.95
[23312]NAT*:
s=172.31.1.161,
d=172.31.233.209->192.168.1.95
[23313]Verify:What
the
NAT
configuration
is
supposed
to
plishThat
the
NAT
entry
exists
in
the
translation
tableand
that
it
is
accurateThat
the
translation
is
actually
taking
place
bymonitoring
the
NAT
process
or
statisticsThat
the
NAT
router
has
the
appropriate
route
inthe
routing
table
if
the
packet
is
going
from
insideto
outsideThat
all
necessary
routers
have
a
return
route
backto
the
translated
address问题:NAT表中存在转换项,但是没有被使用问题:不能ping通远程的主机There
are
no
translations
in
the
table.RouterA#show
ip
nat
translationsProInside
global Inside
localOutside
localOutside
global------------------The
router
interfacesare
inappropriately
definedas
NAT
insideand
NAT
outside.RouterA#
show
ip
nat
statisticsTotal
active
translations:
0
(0
static,
0
dynamic;
0
extended)Outside
interfaces:Ethernet0Inside
interfaces:Serial0Hits:
0 Misses:
0…Pings
are
still
failing
and
there
are
still
no
translations
in
the
table.There
is
an
incorrect
wildcard
bit
mask
in
the
ACL
that
definesthe
addresses
to
be
translated.RouterA#
show
access-listStandard
IP
access
list
2010
permit
0.0.0.0,
wildcard
bits
255.255.255.0Translations
are
now
occurring.Pings
are
still
failing.RouterA#Proshow
ip
nat
translationsInside
global Inside
localOutside
localOutside
global---172.16.17.20
192.168.1.2------Router
B
has
no
route
to
the
translated
network
address
of
172.16.0.0.RouterB#
sh
ip
routeCodes:
C
-
connected,
S
-
static,
R
-
RIP,
M
-
mobile,
B
-
BGPGateway
of
last
resort
is
not
setCRR10.0.0.0/24
is
subnetted,
1
subnets10.1.1.0/24
is
directly
connected,
Serial0192.168.2.0/24
is
subnetted,
1
subnets192.168.2.0/24
is
directly
connected,
Ethernet0192.168.1.0/24
is
variably
subnetted,
3
subnets,
2
masks192.168.1.0/24
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- T/CACE 066-2022基于项目的温室气体减排量核证程序要求
- T/CA 108-2019多媒体设备充电线、数据线通用规范
- 药物性皮炎常见护理诊断
- 车工工艺与技能课件:切断
- 房地产市场库存去化压力解析:2025年营销策略调整与渠道优化报告
- 新生儿结膜炎护理常规
- 工业互联网平台入侵检测系统:2025年网络安全政策与标准优化
- 常见病照护课件:消化系统常见疾病的照护
- 肾小球肾炎的护理笔记
- 塑料泡沫包装设计作业
- 2025-2030年中国磷酸行业市场现状供需分析及投资评估规划分析研究报告
- 2025年市场营销专业人才考核试题及答案
- 分居协议(模版)
- 经鼻高流量吸氧在五官科麻醉气道管理中应用专家共识(2025版)解读
- 养老护理员考试模拟题与答案(附解析)
- 2025届湖北省新八校协作体高三下学期5月壮行考化学试题及答案
- 深圳市住房公积金管理中心员额人员招聘真题2024
- 2025年全国国家版图知识竞赛题库及答案
- 《创伤失血性休克中国急诊专家共识(2023)》解读课件
- 入团志愿书(2016版本)(可编辑打印标准A4) (1)
- 小升初个人简历表
评论
0/150
提交评论