網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗_第1頁
網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗_第2頁
網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗_第3頁
網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗_第4頁
網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗_第5頁
已閱讀5頁,還剩1頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、總結(jié)實驗網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置實驗學號 學生 實驗時間課程名稱:交換機/路由器配置輔導教師:泰峰任務(wù)一利用動態(tài)NAPT實現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng)實驗名稱利用動態(tài)NAPT實現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng)。實驗目的掌握網(wǎng)中所有主機連接到Internet網(wǎng)時,通過端口號區(qū)分的復用部全局地址轉(zhuǎn)換。背景描述你是某公司的網(wǎng)絡(luò)管理員,公司只向ISP申請了一個公網(wǎng)IP地址,希望全公司的主機都能訪問 外網(wǎng),請你實現(xiàn)。技術(shù)原理NAT(網(wǎng)絡(luò)地址轉(zhuǎn)換或網(wǎng)絡(luò)地址翻譯),是指將網(wǎng)絡(luò)地址從一個地址空間轉(zhuǎn)換為另一個地址空間的 行為。NAT將網(wǎng)絡(luò)劃分為部網(wǎng)絡(luò)(inside)和外部網(wǎng)絡(luò)(outside)兩部分。局域網(wǎng)主機利用NAT訪問網(wǎng)絡(luò)時, 是

2、將局域網(wǎng)部的本地地址轉(zhuǎn)換為全局地址(互聯(lián)網(wǎng)合法IP地址)后轉(zhuǎn)發(fā)數(shù)據(jù)包。N燈分為兩種類型:NAT(網(wǎng)絡(luò)地址轉(zhuǎn)換)和NAPT(網(wǎng)絡(luò)地址端口轉(zhuǎn)換)。NAT是實現(xiàn)轉(zhuǎn)換后一個 本地IP地址對應與一個全局地址。NAPT是實現(xiàn)轉(zhuǎn)換后多個IP地址對應一個全局地址。目前網(wǎng)絡(luò)中 由于公網(wǎng)IP地址緊缺,而局域網(wǎng)主機數(shù)較多,因此一般使用動態(tài)的NAPT實現(xiàn)局域網(wǎng)多臺主機共用 一個或少數(shù)幾個公網(wǎng)IP訪問互聯(lián)網(wǎng)。實現(xiàn)功能允許部所有主機在公網(wǎng)地址缺乏的情況下可以訪問外部網(wǎng)絡(luò)。實驗設(shè)備R1762路由器(兩臺)、V.35線纜(1條)、PC (兩臺)直連線或交叉線(2)實驗拓撲192.17.4.2/24192.17.1.2/24實

3、驗步驟步驟1.基本配置局域網(wǎng)路由器Router2基本配置router#configure terminalEnter configuration commands, one per line. End v/ith CNTL/Z. router(config)#hostname router2 router2(config)#interface fastEthernet 1/0 router2(config-if)#ip add 192.17.4.1 255.255.255.0 router2(config-if)#no shutdov/nrouter2(config-if)#exitroute

4、r2(config)#interface serial 1 /2router2(config-if)#ip add 192.17.3.2 255.255.255.0router2(config-if)#no shutdov/nrouter2(config-if)#endrouter2#測試命令:show ip interface brief。Router2#shovv ip int brief!觀察接口狀態(tài)InterfaceIP-Address(Pri)OK?Statusserial 1/2192.17.3.2/24YESUPserial 1/3no addressYESDOWNFastEth

5、ernet 1/0192.17.4.1/24YESUPFastEthernet 1/1no addressYESDOWNNullOno addressYESUP互聯(lián)網(wǎng)路由器Routed基本配置 routerenablePassword:router#configure terminalEnter configuration commands, one per line. End v/ith CNTL/Z. router(config)#hostname routerirouteri (config)#interface fastEthernet 1/0routeri (config-if)#i

6、p add 192.17.1.1 255.255.255.0routeri (config-if )#no shutdov/nrouteri (config-if )#exitrouteri (config)#interface serial 1 /2routeri (config-if)#ip add 192.17.3.1 255.255.255.0routeri (config-if)#clock rate 64000routeri (config-if)#no shutdov/nrouteri (config-if )#exitrouteri (config)#endrouteri#測試

7、命令:show ip interface brief Routeri#show ip int briefI *觀察接口狀態(tài)InterfaceIP-Address(Pri)OK?Statusserial 1/2192.17.3.1/24YESUPserial 1/3no addressYESDOWNFastEthernet 1/0192.17.1.1/24YESUPFastEthernet 1/1no addressYESDOWNNullOno addressYESUP在局域網(wǎng)路由器R2上配置靜態(tài)路由router2(config)#ip route 0.0.0.0 0.0.0.0 serial

8、1/2 在互聯(lián)網(wǎng)路由器R1上配置靜態(tài)路由Routeri (config)#ip route 0.0.0.0 0.0.0.0 serial 1/2測試命令:show ip route。Routeri #show ip route!查看路由表信息Router2#show ip route步驟2. 配置動態(tài)NAPT映射。router2(config)#interface f1 /0router2(config-if)#ip nat inside!定義 F1/0 為網(wǎng)接口router2(config-if)#exitrouter2(config)#interface s1 /2router2(conf

9、ig-if)#ip nat outside !定義 S1/2 為外網(wǎng)接口router2(config-if)#exitrouter2(config)#ip nat pool tojnternet 192.17.3.2 192.17.3.2 netmask 255.255.255.0!定義部全局地址池router2(config)#access-list 10 permit 192.17.4.0 0.0.0.255!定義允許轉(zhuǎn)換的地址router2(config)#ip nat inside source list 10 pool tojnternet overload!為部本地調(diào)用轉(zhuǎn)換地址池r

10、outer2(config)#end步驟3.驗證測試。1、在服務(wù)器192.17.1.2上配置Web服務(wù)。2、在PC機192.17.4.2上測試訪問192.17.1.2的網(wǎng)頁。3、在局域網(wǎng)路由器R2上查看NAPT的映射關(guān)系。router2#show ip ne Pro Inside global tcp 192.17.3.2:1094 tcp 192.17.3.2:1093translationsInside local192.17.4.2:1094192.17.4.2:1093Outside local192.17.1.2:80192.17.1.2:80Outside global192.17

11、.1.2:80192.17.1.2:80注意事項1、不要把inside和outside應用的接口弄錯。2、要加上能使數(shù)據(jù)包向外轉(zhuǎn)發(fā)的路由,比如默認路由。3、盡量不要使用廣域網(wǎng)接口地址作為映射的全局地址,本例中特定僅有一個公網(wǎng)地址,實際 工作中不推薦。參考配置Routeri#show running-config!查看路由器1的全部配置Router2#shovv running-config!查看路由器2的全部配置任務(wù)二 利用NAT實現(xiàn)外網(wǎng)主機訪問網(wǎng)服務(wù)器實驗名稱利用NAT實現(xiàn)外網(wǎng)主機訪問網(wǎng)服務(wù)器。實驗目的掌握NAT源地址轉(zhuǎn)換和目的地址轉(zhuǎn)換的區(qū)別,掌握如何向外網(wǎng)發(fā)布網(wǎng)的服務(wù)器。背景描述你是某公司

12、的網(wǎng)絡(luò)管理員,公司只向ISP申請了一個公網(wǎng)IP地址,現(xiàn)公司的在網(wǎng),要求在互聯(lián) 網(wǎng)也可以訪問公司,請你實現(xiàn)。192.1742是公司W(wǎng)eb服務(wù)器的IP地址。技術(shù)原理NAT(網(wǎng)絡(luò)地址轉(zhuǎn)換或網(wǎng)絡(luò)地址翻譯),是指將網(wǎng)絡(luò)地址從一個地址空間轉(zhuǎn)換為另一個地址空間的 行為。NAT將網(wǎng)絡(luò)劃分為部網(wǎng)絡(luò)(inside)和外部網(wǎng)絡(luò)(outside)兩部分。局域網(wǎng)主機利用NAT訪問網(wǎng)絡(luò)時, 是將局域網(wǎng)部的本地地址轉(zhuǎn)換為全局地址(互聯(lián)網(wǎng)合法IP地址)后轉(zhuǎn)發(fā)數(shù)據(jù)包。Nq分為兩種類型:NAT(網(wǎng)絡(luò)地址轉(zhuǎn)換)和NAPT(網(wǎng)絡(luò)地址端口轉(zhuǎn)換)1: NAT是實現(xiàn)轉(zhuǎn)換后一個 本地IP地址對應與一個全局地址。NAPT是實現(xiàn)轉(zhuǎn)換后多個IP地

13、址對應一個全局地址。目前網(wǎng)絡(luò)中 由于公網(wǎng)IP地址緊缺,而局域網(wǎng)主機數(shù)較多,因此一般使用動態(tài)的NAPT實現(xiàn)局域網(wǎng)多臺主機共用 一個或少數(shù)幾個公網(wǎng)IP訪問互聯(lián)網(wǎng)。實現(xiàn)功能網(wǎng)服務(wù)器能夠轉(zhuǎn)換成外網(wǎng)公網(wǎng)IP,被互聯(lián)網(wǎng)訪問。實驗設(shè)備R1762路由器(兩臺)、V.35線纜(1條)、PC (兩臺)直連線或交叉線(2)實驗拓撲Lan-routerInternet-router實驗步驟步驟1.基本配置局域網(wǎng)路由器RouterZ基本配置router#configure terminalEnter configuration commands, one per line. End v/ith CNTL/Z.route

14、r(config)#hostname router2router2(config)#interface fastEthernet 1/0router2(config-if)#ip add 192.17.4.1 255.255.255.0router2(config-if)#no shutdov/nrouter2(config-if)#exitrouter2(config)#interface serial 1/2router2(config-if)#ip add 192.17.3.2 255.255.255.0router2(config-if)#no shutdownrouter2(conf

15、ig-if)#endrouter2#測試命令:shov/ ip interface brief。Router2#shovv ip int brief!觀察接口狀態(tài)InterfaceIP-Address (Pri)OK?Statusserial 1/2192.17.3.2/24YESUPserial 1/3no addressYESDOWNFastEthernet 1/0192.17.4.1/24YESUPFastEthernet 1/1no addressYESDOWNNull 0no addressYESUP互聯(lián)網(wǎng)路由器Routerl基本配置 routerenablePassword:rou

16、ter#configure terminalEnter configuration commands, one per line. End v/ith CNTL/Z. router(config)#hostname routerirouteri (config)#interface fastEthernet 1 /0routeri (config-if)#ip add 192.17.1.1 255.255.255.0routeri (config-if )#no shutdov/nrouteri (config-if )#exitrouteri (config)#interface seria

17、l 1 /2routeri(config-if)#ip add 192.17.3.1 255.255.255.0routeri (config-if)#clock rate 64000routeri (config-if)#no shutdov/nrouteri (config-if )#exitroute 門(config)#endrouteri#測試命令:shov/ ip interface brief。Routeri#shovv ip int briefI *觀察接口狀態(tài)InterfaceIP-Address(Pri)OK?Statusserial 1/2192.17.3.1/24YES

18、UPserial 1/3no addressYESDOWNFastEthernet 1/0192.17.1.1/24YESUPFastEthernet 1/1no addressYESDOWNNull 0no addressYESUP在局域網(wǎng)路由器R2上配置靜態(tài)路由router2(config)#ip route 0.0.0.0 0.0.0.0 serial 1/2 在互聯(lián)網(wǎng)路由器R1上配置靜態(tài)路由Routeri (config)#ip route 0.0.0.0 0.0.0.0 serial 1 /2測試命令:show ip route。!查看路由表信息Routeri #show ip ro

19、uteRouter2#show ip route 步驟2.配置反向NAT映射。router2 (conf ig)#interface f1 /0router2(config-if)#ip nat inside!定義 F1/0 為網(wǎng)接口router2(config-if)#exitrouter2(config)#interface router2(config-if)#ip nat router2(config-if)#exit router2(config)#ip nat255.255.255.0s1/2outside!定義S1/2為外網(wǎng)接口pool web_server192.17.4.2 192.17.4.2 netmask!定義網(wǎng)服務(wù)器地址池router2(config)#access-list 3

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論