![實(shí)驗(yàn)十六-NAT配置_第1頁(yè)](http://file4.renrendoc.com/view11/M00/32/13/wKhkGWWbLKiAVcuYAAGy4lXjekc462.jpg)
![實(shí)驗(yàn)十六-NAT配置_第2頁(yè)](http://file4.renrendoc.com/view11/M00/32/13/wKhkGWWbLKiAVcuYAAGy4lXjekc4622.jpg)
![實(shí)驗(yàn)十六-NAT配置_第3頁(yè)](http://file4.renrendoc.com/view11/M00/32/13/wKhkGWWbLKiAVcuYAAGy4lXjekc4623.jpg)
![實(shí)驗(yàn)十六-NAT配置_第4頁(yè)](http://file4.renrendoc.com/view11/M00/32/13/wKhkGWWbLKiAVcuYAAGy4lXjekc4624.jpg)
![實(shí)驗(yàn)十六-NAT配置_第5頁(yè)](http://file4.renrendoc.com/view11/M00/32/13/wKhkGWWbLKiAVcuYAAGy4lXjekc4625.jpg)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
實(shí)驗(yàn)十六NAT的配置網(wǎng)絡(luò)地址轉(zhuǎn)換(NAT,NetworkAddressTranslation)被廣泛應(yīng)用于各種類(lèi)型Internet接入方式和各種類(lèi)型的網(wǎng)絡(luò)中。原因很簡(jiǎn)單,NAT不僅完美地解決了lP地址缺乏的問(wèn)題,而且還能夠有效地防止來(lái)自網(wǎng)絡(luò)外部的攻擊,隱藏并保護(hù)網(wǎng)絡(luò)內(nèi)部的計(jì)算機(jī)。NAT的實(shí)現(xiàn)方式有三種,即靜態(tài)轉(zhuǎn)換StaticNat、動(dòng)態(tài)轉(zhuǎn)換DynamicNat和端口多路復(fù)用OverLoad。一、靜態(tài)NAT的配置實(shí)驗(yàn)拓?fù)鋱D如下:一、路由器R1的配置Router>Router>enRouter#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR1R1(config)#interfacefastEthernet0/0R1R1(config-if)#noshutdownR1(config-if)#ipnatinsideR1(config-if)#exitR1(config)#interfaceserial2/0R1R1(config-if)#clockrate64000R1(config-if)#noshutdownR1(config-if)#ipnatoutsideR1(config-if)#exitR1R1(config)#iproute二、路由器R2的配置Router>enRouter#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR2R2(config)#linevty04R2(config-line)#passwordciscoR2(config-line)#loginR2(config-line)#exitR2(config)#interfaceloopback0R2(config-if)#exitR2(config)#interfaceserial2/0R2(config-if)#noshutdown三、PC的配置配置fastethernet的IP地址、子網(wǎng)掩碼和默認(rèn)網(wǎng)關(guān)四、查看和檢測(cè)靜態(tài)內(nèi)部源地址轉(zhuǎn)換R1#debugipnatIPNATdebuggingisonPing的同時(shí)觀察R1的輸出R1#NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[11]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[11]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[12]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[12]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[13]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[13]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[14]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[14]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[15]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[15]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[16]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[16]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[17]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[17]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[18]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[18]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[19]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[19]NAT:s=172.16.1.3->200.1.1.5,d=202.1.1.2[20]NAT*:s=202.1.1.2,d=200.1.1.5->172.16.1.3[20]R1#undebugallAllpossibledebugginghasbeenturnedoffR1#showipnatstatisticsTotaltranslations:11(1static,10dynamic,10extended)OutsideInterfaces:Serial2/0InsideInterfaces:FastEthernet0/0Hits:20Misses:20Expiredtranslations:10Dynamicmappings:R1#showipnattranslationsProInsideglobalInsidelocalOutsidelocalOutsideglobal---200.1.1.5172.16.1.3------Typeescapesequencetoabort.Sending5,100-byteICMPEchosto172.16.1.3,timeoutis2seconds:.....Successrateis0percent(0/5)Typeescapesequencetoabort.Sending5,100-byteICMPEchosto200.1.1.5,timeoutis2seconds:!!!!!Successrateis100percent(5/5),round-tripmin/avg/max=62/62/63ms二、動(dòng)態(tài)NAT的配置實(shí)驗(yàn)拓?fù)鋱D如下:路由器R0配置:R0>enableR0#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.R0(config)#interfacefastEthernet0/0R0(config-if)#ipnatinside//將該接口標(biāo)記為與內(nèi)部連接R0(config-if)#noshutdownR0(config-if)#exitR0(config)#interfaceserial2/0R0(config-if)#clockrate64000R0(config-if)#ipnatoutside//將該接口標(biāo)記為與外部連接R0(config-if)#noshutdownR0(config-if)#exitR0(config)#access-list1permit192.168.1.0.255//定義訪問(wèn)控制列表R0(config)#ipnatinsidesourcelist1poollabR0(config)#iprouteR0(config)#路由器R1配置:R1>enableR1#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.R1(config)#interfaceserial2/0R1(config-if)#noshutdownR1(config-if)#exitR1(config)#interfaceloopback0R1(config-if)#exitR1(config)#linevty04R1(config-line)#passwordciscoR1(config-line)#loginR1(config-line)#主機(jī)0配置ip:192.168.1.2主機(jī)1配置默認(rèn)網(wǎng)關(guān):192.168.1.1監(jiān)測(cè)和查看動(dòng)態(tài)內(nèi)部源地址的轉(zhuǎn)換R0#debugipnatIPNATdebuggingison在主機(jī)0上ping202.1.1.1監(jiān)測(cè)R0路由器的輸出R0#NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[1]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[1]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[2]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[2]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[3]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[3]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[4]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[4]在主機(jī)1上ping202.1.1.1監(jiān)測(cè)R0路由器的輸出R0#NAT:s=192.168.1.3->172.1.10.3,d=202.1.1.1[1]NAT*:s=202.1.1.1,d=172.1.10.3->192.168.1.3[5]NAT:s=192.168.1.3->172.1.10.3,d=202.1.1.1[2]NAT*:s=202.1.1.1,d=172.1.10.3->192.168.1.3[6]NAT:s=192.168.1.3->172.1.10.3,d=202.1.1.1[3]NAT*:s=202.1.1.1,d=172.1.10.3->192.168.1.3[7]NAT:s=192.168.1.3->172.1.10.3,d=202.1.1.1[4]NAT*:s=202.1.1.1,d=172.1.10.3->192.168.1.3[8]R0#undebugallAllpossibledebugginghasbeenturnedoffR0#showipnattranslations//查看NAT轉(zhuǎn)換明細(xì)ProInsideglobalInsidelocalOutsidelocalOutsideglobalicmp172.1.10.2:10192.168.1.2:10202.1.1.1:10202.1.1.1:10icmp172.1.10.2:11192.168.1.2:11202.1.1.1:11202.1.1.1:11icmp172.1.10.2:12192.168.1.2:12202.1.1.1:12202.1.1.1:12icmp172.1.10.2:9192.168.1.2:9202.1.1.1:9202.1.1.1:9icmp172.1.10.3:5192.168.1.3:5202.1.1.1:5202.1.1.1:5icmp172.1.10.3:6192.168.1.3:6202.1.1.1:6202.1.1.1:6icmp172.1.10.3:7192.168.1.3:7202.1.1.1:7202.1.1.1:7icmp172.1.10.3:8192.168.1.3:8202.1.1.1:8202.1.1.1:8三、PAT的配置PAT,即端口地址轉(zhuǎn)換,也稱(chēng)NAT超載或復(fù)用動(dòng)態(tài)地址轉(zhuǎn)換,采用端口多路復(fù)用方式,內(nèi)部網(wǎng)絡(luò)的所有主機(jī)均可共享一個(gè)合法外部IP地址實(shí)現(xiàn)對(duì)Internet的訪問(wèn),從而可以最大限度地節(jié)約IP地址資源。同時(shí),又可隱藏網(wǎng)絡(luò)內(nèi)部的所有主機(jī),有效防止來(lái)自internet的攻擊。實(shí)驗(yàn)拓?fù)鋱D如下:R0路由器的配置:R0>enableR0#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.R0(config)#interfacefastEthernet0/0R0(config-if)#ipnatinsideR0(config-if)#exitR0(config)#interfaceserial2/0R0(config-if)#ipnatoutsideR0(config-if)#exitR0(config)#access-list1permit192.168.1.0.255R0(config)#ipnatinsidesourcelist1poollab2overloadR0(config)#iprouteR0(config)#exitR1路由器配置:按照拓?fù)鋱D上標(biāo)識(shí)的IP進(jìn)行配置R1要配置到172.1.10.2的路由在R0查看和監(jiān)測(cè)復(fù)用內(nèi)部全局地址PATR0#debugipnat在主機(jī)0和主機(jī)1上ping202.1.1.1,監(jiān)測(cè)路由器R0的輸出R0#NAT:s=192.168.1.3->172.1.10.2,d=172.1.1.2[5]NAT*:s=172.1.1.2,d=172.1.10.2->192.168.1.3[13]NAT:s=192.168.1.3->172.1.10.2,d=172.1.1.2[6]NAT*:s=172.1.1.2,d=172.1.10.2->192.168.1.3[14]NAT:s=192.168.1.3->172.1.10.2,d=172.1.1.2[7]NAT*:s=172.1.1.2,d=172.1.10.2->192.168.1.3[15]NAT:s=192.168.1.3->172.1.10.2,d=172.1.1.2[8]NAT*:s=172.1.1.2,d=172.1.10.2->192.168.1.3[16]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[9]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[17]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[10]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[18]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[11]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[19]NAT:s=192.168.1.2->172.1.10.2,d=202.1.1.1[12]NAT*:s=202.1.1.1,d=172.1.10.2->192.168.1.2[20]!access-list1permit192.168.1.0.255R0#showipnattranslations//查看地址轉(zhuǎn)換詳單ProInsideglobalInsidelocalOutsidelocalOutsideglobalicmp172.1.10.2:10192.168.1.2:10202.1.1.1:10202.1.1.1:10icmp172.1.10.2:11192.168.1.2:11202.1.1.1:11202.1.1.1:11icmp172.1.10.2:12192.168.1.2:12202.1.1.1:12202.1.1.1:12icmp172.1.10.2:9192.168.1.2:9202.1.1.1:9202.1.1.1:9icmp172.1.10.2:5192.168.1.3:5172.1.1.2:5172.1.1.2:5icmp172.1.10.2:6192.168.1.3:6172.1.1.2:6172.1.1.2:6icmp172.1.10.2:7192.168.1.3:7172.1.1.2:7172.1.1.2:7icmp172.1.10.2:8192.168.1.3:8172.1.1.2:8172.1.1.2:8R0#showipnatstatisticsTotaltranslations:8(0static,8dynamic,8extended)OutsideInterfaces:Serial2/0InsideInterfaces:FastEthernet0/0Hits:12Misses:20Expiredtranslations:12Dynamicmappings:--InsideSourceaccess-list1poollab2refCount8typegeneric,totaladdresses1,allocated1(100%),misses0R0#方法二,使用NAT地址池方式配置串行接口IP地址復(fù)用NAT,可以在上面實(shí)驗(yàn)根底上做R0(config)#interfaceserial2/0R0(config-if)#exitR0(config)#ipnatpoollab3a172.1.1.1R0(config)#ipnatinsidesourcelist1poollab3aoverload在pc0上ping202.1.1.1在R0上觀察監(jiān)測(cè)的結(jié)果R0#NAT:s=192.168.1.2->172.1.1.1,d=202.1.1.1[13]NAT*:s=202.1.1.1,d=172.1.1.1->192.168.1.2[21]NAT:s=192.168.1.2->172.1.1.1,d=202.1.1.1[14]NAT*:s=202.1.1.1,d=172.1.1.1->192.168.1.2[22]NAT:s=192.168.1.2->172.1.1.1,d=202.1.1.1[15]NAT*:s=202.1.1.1,d=172.1.1.1->192.168.1.2[23]NAT:s=192.168.1.2->172.1.1.1,d=202.1.1.1[16]NAT*:s=202.1.1.1,d=172.1.1.1->192.168.1.2[24]方法三,直接配置串行接口地址復(fù)用NAT的方法,核心命令如下R0(config)#access-list1permit192.168.1.0.255R0(config)#ipnatinsidesourcelist1interfaceserial2/0overload該方法不用創(chuàng)立地址池,直接借用serial2/0的IP地址課后練習(xí)實(shí)驗(yàn)PAT(基于端口的NAT)一、實(shí)驗(yàn)配置拓?fù)鋱D圖一私有網(wǎng)段192.168.1.0/24通過(guò)Company路由器的PAT技術(shù)接入互連網(wǎng)二、路由器的根本配置路由器ISP的配置ISP#shstartup-config
Using582bytes
!
version12.4
servicepassword-encryption
!
hostnameISP
!
enablesecret5$1$mERr$Q1EnFeXJ8Ibdhx2QffKaQ.
enablepassword7083249401018
!
ipsshversion1
!
!
interfaceFastEthernet0/0
noipaddress
duplexauto
speedauto
shutdown
!
interfaceFastEthernet0/1
ipaddress223.1.1.1255.255.255.0
duplexauto
speedauto
!
interfaceSerial0/3/0
ipaddress221.1.1.1255.255.255.0
clockrate56000
!
interfaceSerial0/3/1
noipaddress
shutdown
!
interfaceVlan1
noipaddress
shutdown
!
ipclassless
!
nocdprun
!
linecon0
linevty04
login
!
!
end路由器Company的配置
Company#shstartup-config
Using643bytes
!
version12.4
servicepassword-encryption
!
hostnameCompany
!
!
enablepassword7083249401018
!
ipsshversion1
!
!
interfaceFastEthernet0/0
noipaddress
duplexauto
speedauto
shutdown
!
interfaceFastEthernet0/1
ipaddress192.168.1.1255.255.255.0
ipnatinside
duplexauto
speedauto
!
interfaceSerial0/3/0
ipaddress221.1.1.2255.255.255.0
ipnatoutside
!
interfaceVlan1
noipaddress
shutdown
!
ipnatinsidesourcelist1interfaceSerial0/3/0overload
ipclassless
iproute.00.0.0.0221.1.1.1
!
!
access-list1permit192.168.1.00.0.0.255
!
nocdprun
!
linecon0
linevty04
login
!
!
end在路由器Company上配置PAT的命令
Company(config)#iproute.00.0.0.0221.1.1.1\\配置默認(rèn)路由
Company(config)#access-list1permit192.168.1.00.0.0.255\\配置一個(gè)標(biāo)準(zhǔn)訪問(wèn)控制列表
Company(config)#ipnatinsidesourcelist1interfaceSerial0/3/0overload\\啟用PAT私有IP地址的來(lái)源來(lái)自于ACL1,使用serial0/3/0上的公共IP地址進(jìn)行轉(zhuǎn)換,overload表示使用端口號(hào)進(jìn)行轉(zhuǎn)換
Company(config)#intfa0/1
Company(config-if)#ipnatinside
Company(config-if)#intserial0/3/0
Company(config-if)#ipnatoutside三、校驗(yàn)、查看PAT的配置及運(yùn)行狀況
測(cè)試,中的主機(jī)去pingPC2,在Company上查看轉(zhuǎn)換過(guò)程和轉(zhuǎn)換結(jié)果。然后在實(shí)驗(yàn)拓?fù)鋱D中再添加一臺(tái)效勞器。測(cè)試,在PC0的web瀏覽器
圖三Company#shipnattranslations
ProInsideglobal
Insidelocal
Outsidelocal
Outsideglobal
icmp221.1.1.2:23
192.168.1.3:23
223.1.1.2:23
223.1.1.2:23
icmp221.1.1.2:24
192.168.1.3:24
223.1.1.2:24
223.1.1.2:24
icmp221.1.1.2:25
192.168.1.3:25
223.1.1.2:25
223.1.1.2:25
icmp221.1.1.2:26
192.168.1.3:26
223.1.1.2:26
223.1.1.
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 未來(lái)商業(yè)空間設(shè)計(jì)趨勢(shì)與挑戰(zhàn)應(yīng)對(duì)
- 國(guó)慶節(jié)中秋快樂(lè)活動(dòng)方案
- 16《朱德扁擔(dān)》第二課時(shí) 說(shuō)課稿-2024-2025學(xué)年語(yǔ)文二年級(jí)上冊(cè)統(tǒng)編版
- Unit 2 Healthy Lifestyle Reading and Thinking 說(shuō)課稿-2023-2024學(xué)年高二英語(yǔ)人教版(2019)選擇性必修第三冊(cè)
- Module4 Unit1 It's red!(說(shuō)課稿)-2024-2025學(xué)年外研版(一起)英語(yǔ)一年級(jí)上冊(cè)
- Unit 2 Different families Lesson 6(說(shuō)課稿)-2024-2025學(xué)年人教PEP版(2024)英語(yǔ)三年級(jí)上冊(cè)
- 1《天地人》說(shuō)課稿-2024-2025學(xué)年語(yǔ)文一年級(jí)上冊(cè)統(tǒng)編版
- 2024-2025學(xué)年高中信息技術(shù) 會(huì)考知識(shí)點(diǎn)說(shuō)課稿
- 2024年六年級(jí)品社下冊(cè)《站在國(guó)際舞臺(tái)上》說(shuō)課稿 遼師大版001
- 6 推動(dòng)社會(huì)發(fā)展的印刷術(shù)(說(shuō)課稿)-2024-2025學(xué)年六年級(jí)上冊(cè)科學(xué)教科版(2017版)
- 2024年常德職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性測(cè)試題庫(kù)完整
- 天津市河?xùn)|區(qū)2023-2024學(xué)年九年級(jí)上學(xué)期期末數(shù)學(xué)試題
- 工程防滲漏培訓(xùn)課件
- 黑龍江省哈爾濱市2024年數(shù)學(xué)八年級(jí)下冊(cè)期末經(jīng)典試題含解析
- 克羅恩病的外科治療
- 牛津3000核心詞匯表注釋加音標(biāo)1-4 完整版
- 高中英語(yǔ)以讀促寫(xiě)教學(xué)策略與實(shí)踐研究課件
- 金屬表面處理中的冷噴涂技術(shù)
- 河北省石家莊市2023-2024學(xué)年高一上學(xué)期期末教學(xué)質(zhì)量檢測(cè)化學(xué)試題(解析版)
- 黑龍江省齊齊哈爾市2023-2024學(xué)年高一上學(xué)期1月期末英語(yǔ)試題(含答案解析)
- 綜合素質(zhì)能力提升培訓(xùn)
評(píng)論
0/150
提交評(píng)論