Cisco PIX NAT(地址轉換)詳解

nat和global命令總是一起使用。nat命令定義可以轉換地址以訪問低安全級網絡的本地主機;global命令定義了用於轉換的全局地址池。 nat命

令的nat_id標示符指定了nat命令使用的地址池。
語法:
Pix(config)#global  (if_name) nat_id {global_ip[global_ip] [netmask global_mask]|interface}
Pix(config)#nat  (if_name) nat_id local_ip [netmask]
例:
Pix(config)# global  (outside) 1 215.1.2.0
Pix(config)# global (outside) 1  1.1.1.1-1.1.1.30 netmask 255.255.255.224
Pix(config)# nat (inside) 1  192.168.1.0 255.255.255.0
***
改變或刪除一個nat命令語句後,使用clear xlate命令。
最 多可以定義256個全局地址池。
不要用全局地址池指定了的地址來做靜態映射。
靜態映射擁有比nat命令創建的映射有更高的優先級。
***

指 定內部所有主機的選項
Pix(config)#nat (inside) 1 0 0
0 0是local_ip/netmask  0.0.0.0 0.0.0.0的組合。

更多的NAT選項
nat命令能夠使能或禁止一個或更多的地址轉換,還有很多其他的選項
Pix(config)#  nat (if_name) nat_id ip_address [netmask] [outside] [dns] [norandomseq]
[timeout  hh:mm:ss] [conn_limit] [em_limit]
Pix(config)# no nat (if_name)  nat_id address [netmask] [outside]

NAT_ID選項
NAT 0
nat  0關閉特定地址的NAT轉換,這個結果稱爲identity

translation,這種轉換映射到它自身的地址。這個命令假定主機地址 是一個可在Internet上使用的有效的全局地址。
與static命令不同的是,nat要求連接從內部發起。
Pix(config)#  nat (dmz) 0 1.1.1.15 //該主機可訪問外部網絡
Pix(config)# static (dmz, outside)  1.1.1.15 1.1.1.15  //地址對外部可見

下面例子使用一個C類地址
Pix(config)# nat  (dmz) 0 1.1.2.0 255.255.255.0
Pix(config)# static (dmz, outside)  1.1.2.0 1.1.2.0 netmask 255.255.255.0

NAT 0 Access-List ACL Name
使 用訪問控制列表設置旁路,使特定的傳輸跳過NAT轉換進程。
這個命令假定主機地址是一個可在Internet上使用的有效的全局地址。
Pix(config)#  access-list skip-nat permit ip host 1.1.1.15 host 1.1.2.19
Pix(config)#  nat (inside) 0 access-list skip-nap

NAT_ID 大於0
正常的NAT地址轉換。
Pix(config)#  global (outside) 9 1.1.2.1 - 1.1.2.254
Pix(config)# global (outside)  9 1.1.3.0 netmask 255.255.255.0
Pix(config)# nat (inside) 9  192.168.1.0 255.255.255.0

不使用網絡地址和廣播地址
如下例:
Pix(config)#  global (outside) 1 10.1.1.0 netmask 255.255.255.240
Pix(config)# nat  (inside) 1 192.168.1.0 255.255.255.0
網絡地址10.1.1.0和廣播地址10.1.1.15都被包括在地 址池中,要想不包括他們
Pix(config)# global (outside) 1 10.1.1.1 - 10.1.1.14
Pix(config)#  nat (inside) 1 192.168.1.0 255.255.255.0

檢查NAT/Global配置
show  global
show nat
write terminal
show xlate

PAT
Pix(config)#  global (if_name) nat_id {global_ip [-global_ip] [netmask global_mask]  |interface}
指定一個地址做PAT
Pix(config)# global (outside) 5 1.1.1.25
Pix(config)#  nat (inside) 5 0 0
使用外網接口地址做PAT
Pix(config)# global (outside) 7  interface
Pix(config)# nat (inside) 7 0 0
***
改變或刪除nat命令語句後,應執行 clear xlate命令。
作PAT的地址,不能用到另一個global或static地址池
PAT不支持H.323應用和名稱服務的 caching
當多媒體應用需要穿過防火牆時,不能使用PAT。多媒體應用會與PAT的端口映射衝突。
PAT不支持TCP ACL  "established"選項。
PAT does work with DNS, HTTP, URL filtering, e-mail,  FTP, passive FTP, Telnet,outbound traceroute, and the UNIX RPC and

rshell  protocols.

結合使用NAT和PAT
Pix(config)# global (outside) 3 1.1.3.0  netmask 255.255.255.0
Pix(config)# global (outside) 3 interface
Pix(config)#  nat (inside)3 0 0


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章