Shunze 學園 >電腦資訊學系 >硬底子 > 《分享》Cisco Router NAT設定 哈囉,還沒有註冊或者登入。請你[註冊|登入]
« 上一篇主題 下一篇主題 » 顯示成列印模式 | 增加到我的最愛
發表新主題 發表回覆
作者
主題
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2370

shunze 離線
《分享》Cisco Router NAT設定引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

Cisco Router上支援三種NAT對應方式。

  • Static NAT:靜態NAT轉址。直接指定每個內部Private IP其對外Public IP,固定為1對1的方式。
    有著數量足夠多的外部IP才會進行這種1對1的設定方式。
  • Dynamic NAT:動態NAT轉址。訂定一到數個NAT Pool,指定可用來做為NAT轉址所用的Public IP之集合,供給內部Private IP動態轉址使用。
    內部對外部不見得是同一個IP,為輪流派送。
  • PAT(Port Address Translation):埠號地址轉換,Overlapping。多個私有ip對應到一個公有ip,也是我們一般認知的NAT


以下我們以模擬器來實做PAT內對外的多對一轉換設定。


內部環境
10.0.0.0/24
GW 10.0.0.254

外部環境
192.168.10.0/30
GW 192.168.10.2


內部Router設定
//IP配置
(config)# interface fa 0/0
(config-if)# ip address 10.0.0.254 255.255.255.0
(config-if)# no shutdown
(config-if)# interface fa 0/1
(config-if)# ip address 192.168.10.1 255.255.255.252
(config-if)# no shutdown

//NAT設定
(config)# interface fa 0/0
(config-if)# ip nat inside
(config-if)# interface fa 0/1
(config-if)# ip nat outside
(config-if)# exit

//配置NAT pool,起始IP與結束IP
(config)# ip nat pool NATPool1 192.168.10.1 192.168.10.1 netmask 255.255.255.252

//配置access rule,遮罩格式為wildcard-mask
(config)# access-list 1 permit 10.0.0.0 0.0.0.255

//套用NAT來源端規則
(config)# ip nat inside source list 1 pool NAT Pool1 overload

//設定default route
(config)# ip route 0.0.0.0 0.0.0.0 192.168.10.2


ISP Router設定
//IP配置
(config)# interface fa 0/0
(config-if)# ip address 192.168.10.2 255.255.255.252
(config-if)# no shutdown
(config-if)# interface eth 0/1/0
(config-if)# ip address 123.0.0.254 255.0.0.0.0
(config-if)# no shutdown


偵錯
# show ip nat translations
# show ip nat statistics


↑由圖中可看到local端的PC 10.0.0.1連到123.123.123.1是帶192.168.10.1的IP出去。




參考資料
http://note.tc.edu.tw/747.html
http://blog.roodo.com/kennykao1976/archives/4751865.html

shunze 上傳的檔案
cisco_router_PAT.zip (23 KB, 已經被下載 1485 次)


♥順子老婆的網拍,請多關照∼

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2014-03-02, 12:44 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
  « 上一篇主題 下一篇主題 »
發表新主題 發表回覆
跳到:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR