版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
PacketTracer5.2實驗(十四)網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置PAGEPAGE1————————————————————————————————作者:————————————————————————————————日期: 個人收集整理勿做商業(yè)用途個人收集整理勿做商業(yè)用途個人收集整理勿做商業(yè)用途PacketTracer5。2實驗(十四)網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置一、實驗?zāi)繕?biāo)理解NAT網(wǎng)絡(luò)地址轉(zhuǎn)換的原理及功能;掌握靜態(tài)NAT的配置,實現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng);二、實驗背景公司欲發(fā)布WWW服務(wù),現(xiàn)要求將內(nèi)網(wǎng)Web服務(wù)器IP地址映射為全局IP地址,實現(xiàn)外部網(wǎng)絡(luò)可訪問公司內(nèi)部Web服務(wù)器。三、技術(shù)原理網(wǎng)絡(luò)地址轉(zhuǎn)換NAT(NetworkAddressTranslation),被廣泛應(yīng)用于各種類型Internet接入方式和各種類型的網(wǎng)絡(luò)中。原因很簡單,NAT不僅完美解決了IP地址不足的問題,而且還能夠有效地避免來自網(wǎng)絡(luò)外部的攻擊,隱藏并保護網(wǎng)絡(luò)內(nèi)部的計算機。默認情況下,內(nèi)部IP地址是無法被路由到外網(wǎng)的,內(nèi)部主機10.1。1。1要與外部internet通信,IP包到達NAT路由器時,IP包頭的源地址10。1。1.1被替換成一個合法的外網(wǎng)IP,并在NAT轉(zhuǎn)換表中保存這條記錄。當(dāng)外部主機發(fā)送一個應(yīng)答到內(nèi)網(wǎng)時,NAT路由器收到后,查看當(dāng)前NAT轉(zhuǎn)換表,用10。1.1。1替換掉這個外網(wǎng)地址。NAT將網(wǎng)絡(luò)劃分為內(nèi)部網(wǎng)絡(luò)和外部網(wǎng)絡(luò)兩部分,局域網(wǎng)主機利用NAT訪問網(wǎng)絡(luò)時,是將局域網(wǎng)內(nèi)部的本地地址轉(zhuǎn)換為全局地址(互聯(lián)網(wǎng)合法的IP地址)后轉(zhuǎn)發(fā)數(shù)據(jù)包。NAT分為兩種類型:NAT(網(wǎng)絡(luò)地址轉(zhuǎn)換)和NAPT(網(wǎng)絡(luò)端口地址轉(zhuǎn)換IP地址對應(yīng)一個全局地址)。靜態(tài)NAT:實現(xiàn)內(nèi)部地址與外部地址一對一的映射?,F(xiàn)實中,一般都用于服務(wù)器;動態(tài)NAT:定義一個地址池,自動映射,也是一對一的?,F(xiàn)實中,用得比較少;NAPT:使用不同的端口來映射多個內(nèi)網(wǎng)IP地址到一個指定的外網(wǎng)IP地址,多對一。四、實驗步驟實驗拓撲1、R1為公司出口路由器,其與外部路由之間通過V。35電纜串口連接,DCE端連接在R2上,配置其時鐘頻率為64000;2、配置PC機、服務(wù)器及路由器接口IP地址;3、在各路由器上配置靜態(tài)路由協(xié)議,讓PC間能相互ping通;4、在R1上配置靜態(tài)NAT;5、在R1上定義內(nèi)外部網(wǎng)絡(luò)接口;6、驗證主機之間的互通性。R1:Router>en
Router#conft
Enterconfigurationcommands,oneperline.
EndwithCNTL/Z。
Router(config)#hostnameR1
R1(config)#intfa0/0
R1(config-if)#ipadd192。168.1。1255。255.255.0
R1(config-if)#noshut
%LINK—5-CHANGED:InterfaceFastEthernet0/0,changedstatetoup
%LINEPROTO—5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
R1(config—if)#exit
R1(config)#ints2/0
R1(config-if)#ipadd222。0。1。1255.255.255。0
R1(config-if)#noshut
%LINK-5—CHANGED:InterfaceSerial2/0,changedstatetodown
R1(config—if)#
%LINK—5-CHANGED:InterfaceSerial2/0,changedstatetoup
%LINEPROTO-5—UPDOWN:LineprotocolonInterfaceSerial2/0,changedstatetoup
R1(config-if)#
R1(config—if)#
R1(config—if)#exit
R1(config)#iproute255。255。255。0222.0.1。2//配置到222.0。2.0網(wǎng)段的靜態(tài)路由
R1(config)#end
R1#
%SYS-5-CONFIG_I:Configuredfromconsolebyconsole
R1#showiproute
Codes:C—connected,S—static,I—IGRP,R-RIP,M-mobile,B—BGP
D-EIGRP,EX—EIGRPexternal,O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1—OSPFexternaltype1,E2-OSPFexternaltype2,E-EGP
i-IS-IS,L1-IS—ISlevel-1,L2-IS—ISlevel—2,ia—IS—ISinterarea
*-candidatedefault,U—per-userstaticroute,o—ODR
P-periodicdownloadedstaticroute
Gatewayoflastresortisnotset
C
/24isdirectlyconnected,F(xiàn)astEthernet0/0
C
222.0.1。0/24isdirectlyconnected,Serial2/0
S
222。0.2.0/24[1/0]via222。0.1。2
R1#
R1#
R1#conft
Enterconfigurationcommands,oneperline。
EndwithCNTL/Z.
R1(config)#intfa0/0
R1(config-if)#?
arp
Setarptype(arpa,probe,snap)ortimeout
bandwidth
Setbandwidthinformationalparameter
cdp
CDPinterfacesubcommands
crypto
Encryption/Decryptioncommands
custom-queue—list
Assignacustomqueuelisttoaninterface
delay
Specifyinterfacethroughputdelay
description
Interfacespecificdescription
duplex
Configureduplexoperation。
exit
Exitfrominterfaceconfigurationmode
fair-queue
EnableFairQueuingonanInterface
hold-queue
Setholdqueuedepth
ip
InterfaceInternetProtocolconfigcommands
mac—address
ManuallysetinterfaceMACaddress
mtu
SettheinterfaceMaximumTransmissionUnit(MTU)
no
Negateacommandorsetitsdefaults
priority-group
Assignaprioritygrouptoaninterface
service—policy
ConfigureQoSServicePolicy
shutdown
Shutdowntheselectedinterface
speed
Configurespeedoperation。
tx—ring-limit
ConfigurePAleveltransmitringlimit
zone-member
Applyzonename
R1(config—if)#ip?
access—group
Specifyaccesscontrolforpackets
address
SettheIPaddressofaninterface
hello—interval
ConfiguresIP—EIGRPhellointerval
helper-address
SpecifyadestinationaddressforUDPbroadcasts
inspect
Applyinspectname
ips
CreateIPSrule
mtu
SetIPMaximumTransmissionUnit
nat
NATinterfacecommands
ospf
OSPFinterfacecommands
split-horizon
Performsplithorizon
summary-address
Performaddresssummarization
virtual-reassembly
VirtualReassembly
R1(config-if)#ipnat?
inside
Insideinterfaceforaddresstranslation
outside
Outsideinterfaceforaddresstranslation
R1(config-if)#ipnatinside?
〈cr〉
R1(config—if)#ipnatinside
R1(config-if)#exit
R1(config)#ints2/0
R1(config-if)#ipnatoutside?
<cr〉
R1(config—if)#ipnatoutside
R1(config-if)#exit
R1(config)#
R1#
R1#
R1#conft
Enterconfigurationcommands,oneperline。
EndwithCNTL/Z。
R1(config)#ip?
access—list
Namedaccess-list
default—network
Flagsnetworksascandidatesfordefaultroutes
dhcp
ConfigureDHCPserverandrelayparameters
domain
IPDNSResolver
domain-lookup
EnableIPDomainNameSystemhostnametranslation
domain-name
Definethedefaultdomainname
forward—protocol
ControlsforwardingofphysicalanddirectedIPbroadcasts
host
Addanentrytotheiphostnametable
name—server
Specifyaddressofnameservertouse
nat
NATconfigurationcommands
route
Establishstaticroutes
tcp
GlobalTCPparameters
R1(config)#ipnat?
inside
Insideaddresstranslation
outside
Outsideaddresstranslation
pool
Definepoolofaddresses
R1(config)#ipnatinside?
source
Sourceaddresstranslation
R1(config)#ipnatinsidesource?
list
Specifyaccesslistdescribinglocaladdresses
static
Specifystaticlocal—〉globalmapping
R1(config)#ipnatinsidesourcestatic?
A。B.C.D
InsidelocalIPaddress
tcp
TransmissionControlProtocol
udp
UserDatagramProtocol
R1(config)#ipnatinsidesourcestatic192。168。1.2?
A.B。C.D
InsideglobalIPaddress
R1(config)#ipnatinsidesourcestatic192.168。1。2222。0。1。3?
〈cr〉
R1(config)#ipnatinsidesourcestatic192。168。1。2222.0.1。3//配置內(nèi)網(wǎng)到外網(wǎng)的靜態(tài)NAT映射
R1(config)#end
R1#
%SYS—5—CONFIG_I:Configuredfromconsolebyconsole
R1#showipnat?
statistics
Translationstatistics
translations
Translationentries
R1#showipnattranslations
Pro
Insideglobal
Insidelocal
Outsidelocal
Outsideglobal
--—
222.0。1。3
192。168.1。2
--—
-—-
R1#
R1#showipnattranslations
Pro
Insideglobal
Insidelocal
Outsidelocal
Outsideglobal
-——
192。168。1。2
———
——-
tcp222.0。1。3:80
192。168.1。2:80
222。0。2.2:1025
:1025
R1#
R1#showrunning—config
Buildingconfiguration。。.
Currentconfiguration:753bytes
!
version12.2
noservicetimestampslogdatetimemsec
noservicetimestampsdebugdatetimemsec
noservicepassword—encryption
!
hostnameR1
!
.。.
!
interfaceFastEthernet0/0
ipaddress192.168。1.1255.255.255。0
ipnatinside
duplexauto
speedauto
!
interfaceFastEthernet1/0
noipaddress
duplexauto
speedauto
shutdown
!
interfaceSerial2/0
ipaddress222。0.1.1
ipnatoutside
!
interfaceSerial3/0
noipaddress
shutdown
!
interfaceFastEthernet4/0
noipaddress
shutdown
!
interfaceFastEthernet5/0
noipaddress
shutdown
!
ipnatinsidesourcestatic192。168。1.2
ipclassless
iproute222.0。2。0255。255。255。0
!
..。
!
linecon0
linevty04
login
!
!
!
end
R1#本文為互聯(lián)網(wǎng)收集,請勿用作商業(yè)用途個人收集整理,勿做商業(yè)用途R2:Router〉Router>enRouter#conftEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR2R2(config)#intfa0/0R2(config-if)#ipadd222.0.2。1255。255。255。0R2(config-if)#noshut%LINK-5—CHANGED:InterfaceFastEthernet0/0,changedstatetoup%LINEPROTO-5—UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoupR2(config—if)#exitR2(config)#ints2/0R2(config—if)#ipadd222.0。1。2255。255.255.0R2(config-if)#noshut%LINK—5—CHANGED:InterfaceSerial2/0,changedstatetoupR2(config-if)#clockrate64000R2(config—if)#%LINEPROTO—5-UPDOWN:LineprotocolonInterfaceSerial2/0,changedstatetoupR2(config—if)#R2(config—if)#R2(config-if)#exitR2(config)#iproute192。168.1。0255。255.255。0222。0.1。1R2(config)#endR2#%SYS-5—CONFIG_I:ConfiguredfromconsolebyconsoleR2#showiprouteCodes:C-connected,S-static,I-IGRP,R—RIP,M-mobile,B-BGPD-EIGRP,EX—EIGRPexternal,O—OSPF,N1—OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2—OS
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025江蘇淮安市洪澤區(qū)中醫(yī)院招聘合同制專業(yè)技術(shù)人員2人(第二批)備考考試試題及答案解析
- 團結(jié)部門的活動策劃方案
- 2025四川綿陽市中心醫(yī)院合同制工勤人員招聘3人參考考試試題及答案解析
- 2025福建福州市園開港灣經(jīng)貿(mào)有限公司招聘1人參考筆試題庫附答案解析
- 2025江蘇南通市蘇錫通科技產(chǎn)業(yè)園區(qū)招商服務(wù)有限公司第二批次招聘延期模擬筆試試題及答案解析
- 2025湖南郴州市第四人民醫(yī)院招聘(引進)高層次專業(yè)技術(shù)人才24人參考考試試題及答案解析
- 深度解析(2026)《GBT 25728-2024糧油機械 氣壓磨粉機》
- 2025人民網(wǎng)寧夏分公司招聘媒介顧問2人參考筆試題庫附答案解析
- 2026年河北張家口經(jīng)開區(qū)編辦青年就業(yè)見習(xí)崗位招聘備考筆試試題及答案解析
- 2025青海海南州同德縣人民醫(yī)院招聘消防專職人員1人參考筆試題庫附答案解析
- 振蕩浮子式波浪能發(fā)電創(chuàng)新創(chuàng)業(yè)項目商業(yè)計劃書
- GB 3608-2025高處作業(yè)分級
- 2025年贛州市崇義縣發(fā)展投資集團有限公司2025年第一批公開招聘19人筆試歷年典型考點題庫附帶答案詳解2套試卷
- 稻谷原料銷售合同范本
- 老舊小區(qū)消防安全改造施工方案
- 2025年修船業(yè)行業(yè)分析報告及未來發(fā)展趨勢預(yù)測
- 鄭州鐵路職業(yè)技術(shù)學(xué)院單招網(wǎng)試題庫及答案
- 2025至2030全球及中國光學(xué)氣體成像(OGI)相機行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2024-2025學(xué)年廣西壯族自治區(qū)河池市人教PEP版(2012)六年級上學(xué)期11月期中英語試卷 (含答案)
- 關(guān)于《公務(wù)員法》及政策法規(guī)貫徹執(zhí)行自查報告
- 2025遼寧沈陽市鐵西區(qū)總工會招聘工會社會工作者21人考試參考題庫及答案解析
評論
0/150
提交評論