




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
NAT(Network
Address
Translation)網(wǎng)絡(luò)地址轉(zhuǎn)換NAT-網(wǎng)絡(luò)地址轉(zhuǎn)換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地址轉(zhuǎn)換的具體過程N(yùn)AT術(shù)語(yǔ)內(nèi)部本地轉(zhuǎn)換之前內(nèi)部源地址的名字外部本地轉(zhuǎn)換之前目標(biāo)主機(jī)的名字內(nèi)部全局轉(zhuǎn)換之后內(nèi)部主機(jī)的名字外部全局轉(zhuǎn)換之后外部目標(biāo)主機(jī)的名字內(nèi)部本地Internet內(nèi)部全局外部全局外部本地insideoutsideoutsideinsideNAT三種類型1
靜態(tài)NAT將內(nèi)部本地地址與內(nèi)部全局地址進(jìn)行一對(duì)一的明確轉(zhuǎn)換。這種方法主要用在內(nèi)部網(wǎng)絡(luò)中有對(duì)外提供服務(wù)的服務(wù)器,如WEB、MAIL服務(wù)器時(shí)。該方法的缺點(diǎn)是需要獨(dú)占寶貴的合法IP地址。即,如果某個(gè)合法IP地址已經(jīng)被NAT靜態(tài)地址轉(zhuǎn)換定義,即使該地址當(dāng)前沒有被使用,也不能被用作其它的地址轉(zhuǎn)換。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配置靜態(tài)NAT轉(zhuǎn)換配置靜態(tài)NAT轉(zhuǎn)換-舉例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
動(dòng)態(tài)NAT動(dòng)態(tài)地址轉(zhuǎn)換也是將內(nèi)部本地地址與內(nèi)部全局地址進(jìn)行一對(duì)一的轉(zhuǎn)換。但是,是從內(nèi)部全局地址池中動(dòng)態(tài)地選擇一個(gè)未使用的地址對(duì)內(nèi)部本地地址進(jìn)行轉(zhuǎn)換。該地址是由未被使用的地址組成的地址池中在定義時(shí)排在最前面的一個(gè)。當(dāng)數(shù)據(jù)傳輸完畢后,路由器將把使用完的內(nèi)部全局地址放回到地址池中,以供其它內(nèi)部本地地址進(jìn)行轉(zhuǎn)換。但是在該地址被使用時(shí),不能用該地址再進(jìn)行一次轉(zhuǎn)換。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配置動(dòng)態(tài)NAT轉(zhuǎn)換配置動(dòng)態(tài)NAT轉(zhuǎn)換-舉例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端口復(fù)用復(fù)用地址轉(zhuǎn)換也稱為端口地址轉(zhuǎn)換(Port
Address
Translation,PAT),首先是一種動(dòng)態(tài)地址轉(zhuǎn)換。路由器將通過記錄地址、應(yīng)用程序端口等唯一標(biāo)識(shí)一個(gè)轉(zhuǎn)換。通過這種轉(zhuǎn)換,可以使多個(gè)內(nèi)部本地地址同時(shí)與同一個(gè)內(nèi)部全局地址進(jìn)行轉(zhuǎn)換并對(duì)外部網(wǎng)絡(luò)進(jìn)行訪問。對(duì)于只申請(qǐng)到少量IP地址甚至只有一個(gè)合法IP地址,卻經(jīng)常有很多用戶同時(shí)要求上網(wǎng)的情況,這種轉(zhuǎn)換方式非常有用理想狀況下,一個(gè)單一的IP地址可以使用的端口數(shù)為4000個(gè)理解PAT地址轉(zhuǎn)換(Overloading)配置PAT地址轉(zhuǎn)換(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地址轉(zhuǎn)換(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
轉(zhuǎn)換表項(xiàng)問題:在NAT表中沒有轉(zhuǎn)換項(xiàng)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…顯示相關(guān)的轉(zhuǎn)換信息: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表中存在轉(zhuǎn)換項(xiàng),但是沒有被使用問題:不能ping通遠(yuǎn)程的主機(jī)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. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2023九年級(jí)數(shù)學(xué)上冊(cè) 第22章 一元二次方程22.2 一元二次方程的解法 4一元二次方程根的判別式教學(xué)實(shí)錄 (新版)華東師大版
- 2024-2025學(xué)年高中地理 第2章 旅游資源的綜合評(píng)價(jià) 章末分層突破教學(xué)實(shí)錄 中圖版選修3
- T-TBD 005-2024 微生物肥料中活菌的快速檢測(cè)細(xì)則
- DB6108-T 74-2023 沙區(qū)光伏電站防風(fēng)固沙及生物養(yǎng)護(hù)技術(shù)規(guī)程
- JJF 2192-2025 低霜點(diǎn)濕度發(fā)生器校準(zhǔn)規(guī)范
- 一年級(jí)思想品德上冊(cè) 寒冷的冬天教學(xué)實(shí)錄1 山東人民版
- DB1331T 092-2024甘薯小拱棚促早熟栽培技術(shù)規(guī)程
- 2025年火工產(chǎn)品項(xiàng)目發(fā)展計(jì)劃
- 第一單元認(rèn)識(shí)幾何畫板第1課《用于作圖》教學(xué)設(shè)計(jì) 啟動(dòng)幾何畫板 2023-2024學(xué)年人教版初中信息技術(shù)八年級(jí)下冊(cè)
- 施工現(xiàn)場(chǎng)倉(cāng)庫(kù)防火要求課件
- 消防設(shè)施操作員實(shí)戰(zhàn)試題及答案分享
- 2025年北京電子科技職業(yè)學(xué)院高職單招(數(shù)學(xué))歷年真題考點(diǎn)含答案解析
- 新東方在國(guó)際教育領(lǐng)域的布局與市場(chǎng)機(jī)會(huì)
- 2025年上半年??谑忻捞m區(qū)水務(wù)局下屬事業(yè)單位招考易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025屆高三化學(xué)二輪復(fù)習(xí) 化學(xué)反應(yīng)原理綜合 課件
- 2025年公務(wù)車輛租賃管理合同范本
- 2025年會(huì)計(jì)招聘的面試題及答案
- 9.3.2《設(shè)計(jì)簡(jiǎn)單裝置制作酸奶》跨學(xué)科實(shí)踐主題學(xué)習(xí)單元教學(xué)設(shè)計(jì)
- 2025年工程測(cè)量員(技師)職業(yè)技能鑒定理論考試指導(dǎo)題庫(kù)(含答案)
- 盈浦街道村務(wù)工作者招聘真題2024
- 金屬熔融崗位培訓(xùn)課件
評(píng)論
0/150
提交評(píng)論