ccna设备的NAT地址转换
NAT
NAT設(shè)備將地址分成本地和全局
本地地址是內(nèi)部世界的設(shè)備所能看到的地址。?
全局地址是外部世界的設(shè)備所能看到的地址.
內(nèi)部本地地址(IL)?
分配給內(nèi)部設(shè)備的地址。這些地址不能被通告給外部網(wǎng)絡(luò)。?
內(nèi)部全局地址(IG)
外部網(wǎng)絡(luò)設(shè)備通過這些地址獲悉內(nèi)網(wǎng)設(shè)備。?
外部全局地址(OG)?
分配給外部世界的地址。這些地址不能被通告進內(nèi)部網(wǎng)絡(luò)。
外部本地地址(OL)
內(nèi)部網(wǎng)絡(luò)設(shè)備通過這些地址獲悉外網(wǎng)設(shè)備
靜態(tài) NAT
采用靜態(tài)地址翻譯,需要在兩個地址之間手動建立轉(zhuǎn)換條目。
如果主機數(shù)量很多,就需要在地址轉(zhuǎn)換表中創(chuàng)建多個靜態(tài)條目。
動態(tài) NAT
當(dāng)內(nèi)部用戶想要訪問外部網(wǎng)絡(luò)的資源時,通常采用動態(tài)NAT。
采用動態(tài)NAT,必須在負(fù)責(zé)地址轉(zhuǎn)換的設(shè)備上定義兩個地址集。
一個地址集定義了哪些內(nèi)部地址可以被轉(zhuǎn)換,另一個地址集定義
了這些地址將被轉(zhuǎn)換成什么樣的地址。
?
端口地址轉(zhuǎn)換
靜態(tài)和動態(tài)NAT的一個問題是他們提供的是一對一的轉(zhuǎn)換
如果有5000臺內(nèi)部主機同時訪問英特網(wǎng),在全局地址池中則需要5000
個公有地址與之對應(yīng)。如果地址池中只有1000個地址,僅僅只有1000
臺主機在這一時刻得到轉(zhuǎn)換,而剩下的4000臺則無法訪問外部網(wǎng)絡(luò)。
使用相同地址進行轉(zhuǎn)換
采用PAT,所有的主機數(shù)據(jù)包在經(jīng)過地址轉(zhuǎn)換設(shè)備時都被轉(zhuǎn)換成一個
相同的地址,同時端口號也會被轉(zhuǎn)換,轉(zhuǎn)換后的端口號在轉(zhuǎn)換表中是
唯一的。
配置和驗證靜態(tài)轉(zhuǎn)換
Establishes static translation between an inside local address and an
inside global address
RouterX(config)# ip nat inside source static local-ip global-ip
Marks the interface as connected to the inside
RouterX(config-if)# ip nat inside
Marks the interface as connected to the outside
RouterX(config-if)# ip nat outside
Displays active translations
RouterX# show ip nat translations
?
配置和驗證動態(tài)轉(zhuǎn)換
Defines a pool of global addresses to be allocated as needed
RouterX(config)# ip nat pool name start-ip end-ip
{netmask netmask | prefix-length prefix-length}
Defines a standard IP ACL permitting those inside local addresses?
that are to be translated
RouterX(config)# access-list access-list-number permit
source [source-wildcard]
Establishes dynamic source translation, specifying the ACL that was?
defined in the previous step
RouterX(config)# ip nat inside source list
access-list-number pool name?
Displays active translations
RouterX# show ip nat translations
?
配置過載
Defines a standard IP ACL that will permit the inside local addresses?
that are to be translated
RouterX(config)# access-list access-list-number permit
source source-wildcard
Establishes dynamic source translation, specifying the ACL that was
defined in the previous step?
RouterX(config)# ip nat inside source list
access-list-number interface interface overload
Displays active translations?
RouterX# show ip nat translations
?
清空 NAT 轉(zhuǎn)換表
Clears all dynamic address translation entries
RouterX# clear ip nat translation *
Clears a simple dynamic translation entry that contains an inside?
translation or both an inside and outside translation?
RouterX# clear ip nat translation inside global-ip local-ip [outside local-ip global-ip]
Clears a simple dynamic translation entry that contains an outside translation?
RouterX# clear ip nat translation outside local-ip global-ip
Clears an extended dynamic translation entry (PAT entry)
RouterX# clear ip nat translation protocol inside global-ip
global-port local-ip local-port [outside local-ip
local-port global-ip global-port]?
?
NAT 排錯
確保:
沒有入向ACL拒絕數(shù)據(jù)包進入NAT路由器。
NAT策略中所調(diào)用的ACL已經(jīng)匹配了所有需要被轉(zhuǎn)換的地址段。
NAT地址池中有足夠的地址來滿足轉(zhuǎn)換的需求。
在NAT路由器上正確地定義了inside接口和outside接口。
沒有發(fā)生轉(zhuǎn)換:轉(zhuǎn)換表中沒有安裝相關(guān)條目
show 和 debug
RouterX# debug ip nat
RouterX# show ip nat statistics
?
NAT 排錯(續(xù))
確定:
NAT的配置是否已經(jīng)完成。
NAT轉(zhuǎn)換表中是否已經(jīng)存在正確的條目。
通過監(jiān)控NAT進程來判斷正確的轉(zhuǎn)換是否發(fā)生。
NAT路由器的路由表中是否有正確的路由將數(shù)據(jù)包從inside接口轉(zhuǎn)
移到outside接口。(NAT在outside接口生根)
公網(wǎng)路由器是否有去往轉(zhuǎn)換后地址的回程路由。
?
轉(zhuǎn)載于:https://blog.51cto.com/taosq/1085806
總結(jié)
以上是生活随笔為你收集整理的ccna设备的NAT地址转换的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: asp.net MVC 路由
- 下一篇: 修改Eclipse格式化代默认长度