版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、網(wǎng)絡(luò)地址轉(zhuǎn)換NAT配置一、實(shí)驗(yàn)?zāi)繕?biāo)· 理解NAT網(wǎng)絡(luò)地址轉(zhuǎn)換的原理及功能;· 掌握靜態(tài)NAT的配置,實(shí)現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng);二、實(shí)驗(yàn)背景公司欲發(fā)布WWW服務(wù),現(xiàn)要求將內(nèi)網(wǎng)Web服務(wù)器IP地址映射為全局IP地址,實(shí)現(xiàn)外部網(wǎng)絡(luò)可訪問公司內(nèi)部Web服務(wù)器。三、技術(shù)原理· 網(wǎng)絡(luò)地址轉(zhuǎn)換NAT(Network Address Translation),被廣泛應(yīng)用于各種類型Internet接入方式和各種類型的網(wǎng)絡(luò)中。原因很簡單,NAT不僅完美解決了IP地址不足的問題,而且還能夠有效地避免來自網(wǎng)絡(luò)外部的攻擊,隱藏并保護(hù)網(wǎng)絡(luò)內(nèi)部的計(jì)算機(jī)。· 默認(rèn)情況下,內(nèi)部IP地址是無法
2、被路由到外網(wǎng)的,內(nèi)部主機(jī).1要與外部internet通信,IP包到達(dá)NAT路由器時(shí),IP包頭的源地址被替換成一個(gè)合法的外網(wǎng)IP,并在NAT轉(zhuǎn)換表中保存這條記錄。當(dāng)外部主機(jī)發(fā)送一個(gè)應(yīng)答到內(nèi)網(wǎng)時(shí),NAT路由器收到后,查看當(dāng)前NAT轉(zhuǎn)換表,用替換掉這個(gè)外網(wǎng)地址。· NAT將網(wǎng)絡(luò)劃分為內(nèi)部網(wǎng)絡(luò)和外部網(wǎng)絡(luò)兩部分,局域網(wǎng)主機(jī)利用NAT訪問網(wǎng)絡(luò)時(shí),是將局域網(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)一個(gè)全局地址)。· 靜態(tài)NAT:實(shí)現(xiàn)內(nèi)部
3、地址與外部地址一對一的映射?,F(xiàn)實(shí)中,一般都用于服務(wù)器;· 動(dòng)態(tài)NAT:定義一個(gè)地址池,自動(dòng)映射,也是一對一的?,F(xiàn)實(shí)中,用得比較少;· NAPT:使用不同的端口來映射多個(gè)內(nèi)網(wǎng)IP地址到一個(gè)指定的外網(wǎng)IP地址,多對一。四、實(shí)驗(yàn)步驟實(shí)驗(yàn)拓?fù)?、R1為公司出口路由器,其與外部路由之間通過V.35電纜串口連接,DCE端連接在R2上,配置其時(shí)鐘頻率為64000;2、配置PC機(jī)、服務(wù)器及路由器接口IP地址;3、在各路由器上配置靜態(tài)路由協(xié)議,讓PC間能相互ping通;4、在R1上配置靜態(tài)NAT;5、在R1上定義內(nèi)外部網(wǎng)絡(luò)接口;6、驗(yàn)證主機(jī)之間的互通性。R1:Router>enRout
4、er#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1R1(config)#int fa0/0R1(config-if)#ip add R1(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, ch
5、anged state to upR1(config-if)#exitR1(config)#int s2/0R1(config-if)#ip add R1(config-if)#no shut%LINK-5-CHANGED: Interface Serial2/0, changed state to downR1(config-if)#%LINK-5-CHANGED: Interface Serial2/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, ch
6、anged state to upR1(config-if)#R1(config-if)#R1(config-if)#exitR1(config)#ip route /配置到網(wǎng)段的靜態(tài)路由R1(config)#endR1#%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip routeCodes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA
7、 - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o ODRP - periodic downloaded static rou
8、teGateway of last resort is not setC is directly connected, FastEthernet0/0C is directly connected, Serial2/0S 1/0 via R1#R1#R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#int fa0/0R1(config-if)#? arp Set arp type (arpa, probe, snap) or timeout bandwidth Set
9、 bandwidth informational parameter cdp CDP interface subcommands crypto Encryption/Decryption commands custom-queue-list Assign a custom queue list to an interface delay Specify interface throughput delay description Interface specific description duplex Configure duplex operation. exit Exit from in
10、terface configuration mode fair-queue Enable Fair Queuing on an Interface hold-queue Set hold queue depth ip Interface Internet Protocol config commands mac-address Manually set interface MAC address mtu Set the interface Maximum Transmission Unit (MTU) no Negate a command or set its defaults priori
11、ty-group Assign a priority group to an interface service-policy Configure QoS Service Policy shutdown Shutdown the selected interface speed Configure speed operation. tx-ring-limit Configure PA level transmit ring limit zone-member Apply zone nameR1(config-if)#ip ? access-group Specify access contro
12、l for packets address Set the IP address of an interface hello-interval Configures IP-EIGRP hello interval helper-address Specify a destination address for UDP broadcasts inspect Apply inspect name ips Create IPS rule mtu Set IP Maximum Transmission Unit nat NAT interface commands ospf OSPF interfac
13、e commands split-horizon Perform split horizon summary-address Perform address summarization virtual-reassembly Virtual ReassemblyR1(config-if)#ip nat ? inside Inside interface for address translation outside Outside interface for address translationR1(config-if)#ip nat inside ? <cr>R1(config-
14、if)#ip nat inside R1(config-if)#exitR1(config)#int s2/0R1(config-if)#ip nat outside ? <cr>R1(config-if)#ip nat outside R1(config-if)#exitR1(config)#R1#R1#R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#ip ? access-list Named access-list default-network Flags net
15、works as candidates for default routes dhcp Configure DHCP server and relay parameters domain IP DNS Resolver domain-lookup Enable IP Domain Name System hostname translation domain-name Define the default domain name forward-protocol Controls forwarding of physical and directed IP broadcasts host Ad
16、d an entry to the ip hostname table name-server Specify address of name server to use nat NAT configuration commands route Establish static routes tcp Global TCP parametersR1(config)#ip nat ? inside Inside address translation outside Outside address translation pool Define pool of addressesR1(config
17、)#ip nat inside ? source Source address translationR1(config)#ip nat inside source ? list Specify access list describing local addresses static Specify static local->global mappingR1(config)#ip nat inside source static ? Inside local IP address tcp Transmission Control Protocol udp User Datagram
18、ProtocolR1(config)#ip nat inside source static ? Inside global IP addressR1(config)#ip nat inside source static ? <cr>R1(config)#ip nat inside source static /配置內(nèi)網(wǎng)到外網(wǎng)的靜態(tài)NAT映射R1(config)#endR1#%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip nat ? statistics Translation statistics tr
19、anslations Translation entriesR1#show ip nat translations Pro Inside global Inside local Outside local Outside global- - -R1#R1#show ip nat translations Pro Inside global Inside local Outside local Outside global- - -tcp :80 :80 :1025 :1025R1#R1#show running-con
20、fig Building configuration.Current configuration : 753 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname R1!.!interface FastEthernet0/0 ip address ip nat inside duplex auto speed auto!interface Fast
21、Ethernet1/0 no ip address duplex auto speed auto shutdown!interface Serial2/0 ip address ip nat outside!interface Serial3/0 no ip address shutdown!interface FastEthernet4/0 no ip address shutdown!interface FastEthernet5/0 no ip address shutdown!ip nat inside source static ip classlessi
22、p route !.!line con 0line vty 0 4 login!endR1#R2:Router>Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R2R2(config)#int fa0/0R2(config-if)#ip add R2(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINE
23、PROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR2(config-if)#exitR2(config)#int s2/0R2(config-if)#ip add R2(config-if)#no shut%LINK-5-CHANGED: Interface Serial2/0, changed state to upR2(config-if)#clock rate 64000R2(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Int
24、erface Serial2/0, changed state to upR2(config-if)#R2(config-if)#R2(config-if)#exitR2(config)#ip route R2(config)#endR2#%SYS-5-CONFIG_I: Configured from console by consoleR2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OS
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年廣西公務(wù)員申論考試真題及答案-A卷
- 2025年滬教版高二數(shù)學(xué)上冊月考試卷
- 2025年人教新起點(diǎn)選修1歷史上冊月考試卷含答案
- 2025年粵教新版九年級地理上冊月考試卷
- 2025年人教五四新版七年級生物上冊階段測試試卷
- 2025年蘇人新版七年級生物上冊月考試卷含答案
- 2025年粵人版選擇性必修1語文上冊階段測試試卷
- 2025年北師大版八年級生物下冊月考試卷含答案
- 二零二五年度木門及木飾面定制化生產(chǎn)與安裝服務(wù)合同4篇
- 二零二五版親子閱讀活動(dòng)組織服務(wù)合同4篇
- 江蘇省蘇州市2024-2025學(xué)年高三上學(xué)期1月期末生物試題(有答案)
- 銷售與銷售目標(biāo)管理制度
- 人教版(2025新版)七年級下冊英語:寒假課內(nèi)預(yù)習(xí)重點(diǎn)知識(shí)默寫練習(xí)
- 2024年食品行業(yè)員工勞動(dòng)合同標(biāo)準(zhǔn)文本
- 2025年第一次工地開工會(huì)議主要議程開工大吉模板
- 全屋整裝售后保修合同模板
- 高中生物學(xué)科學(xué)推理能力測試
- GB/T 44423-2024近紅外腦功能康復(fù)評估設(shè)備通用要求
- 2024-2030年中國減肥行業(yè)市場發(fā)展分析及發(fā)展趨勢與投資研究報(bào)告
- 運(yùn)動(dòng)技能學(xué)習(xí)
- 2024年中考英語專項(xiàng)復(fù)習(xí):傳統(tǒng)文化的魅力(閱讀理解+完型填空+書面表達(dá))(含答案)
評論
0/150
提交評論