




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、網(wǎng)絡地址轉(zhuǎn)換NAT配置一、實驗目標· 理解NAT網(wǎng)絡地址轉(zhuǎn)換的原理及功能;· 掌握靜態(tài)NAT的配置,實現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng);二、實驗背景公司欲發(fā)布WWW服務,現(xiàn)要求將內(nèi)網(wǎng)Web服務器IP地址映射為全局IP地址,實現(xiàn)外部網(wǎng)絡可訪問公司內(nèi)部Web服務器。三、技術原理· 網(wǎng)絡地址轉(zhuǎn)換NAT(Network Address Translation),被廣泛應用于各種類型Internet接入方式和各種類型的網(wǎng)絡中。原因很簡單,NAT不僅完美解決了IP地址不足的問題,而且還能夠有效地避免來自網(wǎng)絡外部的攻擊,隱藏并保護網(wǎng)絡內(nèi)部的計算機。· 默認情況下,內(nèi)部IP地址是無法
2、被路由到外網(wǎng)的,內(nèi)部主機.1要與外部internet通信,IP包到達NAT路由器時,IP包頭的源地址被替換成一個合法的外網(wǎng)IP,并在NAT轉(zhuǎn)換表中保存這條記錄。當外部主機發(fā)送一個應答到內(nèi)網(wǎng)時,NAT路由器收到后,查看當前NAT轉(zhuǎn)換表,用替換掉這個外網(wǎng)地址。· NAT將網(wǎng)絡劃分為內(nèi)部網(wǎng)絡和外部網(wǎng)絡兩部分,局域網(wǎng)主機利用NAT訪問網(wǎng)絡時,是將局域網(wǎng)內(nèi)部的本地地址轉(zhuǎn)換為全局地址(互聯(lián)網(wǎng)合法的IP地址)后轉(zhuǎn)發(fā)數(shù)據(jù)包。· NAT分為兩種類型:NAT(網(wǎng)絡地址轉(zhuǎn)換)和NAPT(網(wǎng)絡端口地址轉(zhuǎn)換IP地址對應一個全局地址)。· 靜態(tài)NAT:實現(xiàn)內(nèi)部
3、地址與外部地址一對一的映射。現(xiàn)實中,一般都用于服務器;· 動態(tài)NAT:定義一個地址池,自動映射,也是一對一的?,F(xiàn)實中,用得比較少;· NAPT:使用不同的端口來映射多個內(nèi)網(wǎng)IP地址到一個指定的外網(wǎng)IP地址,多對一。四、實驗步驟實驗拓撲1、R1為公司出口路由器,其與外部路由之間通過V.35電纜串口連接,DCE端連接在R2上,配置其時鐘頻率為64000;2、配置PC機、服務器及路由器接口IP地址;3、在各路由器上配置靜態(tài)路由協(xié)議,讓PC間能相互ping通;4、在R1上配置靜態(tài)NAT;5、在R1上定義內(nèi)外部網(wǎng)絡接口;6、驗證主機之間的互通性。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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZZB Q071-2024 酶底物法微生物智能培養(yǎng)計數(shù)一體機
- T-ZJHIA 16-2024 特殊醫(yī)學用途配方食品臨床營養(yǎng)治療營養(yǎng)篩查數(shù)據(jù)集
- 二零二五年度離婚協(xié)議中夫妻共同財產(chǎn)清算補充協(xié)議
- 二零二五年度直播帶貨主播合作權益保障合同
- 2025年度智能制造合作伙伴協(xié)議書
- 二零二五年度木制家具生產(chǎn)廠木工用工協(xié)議書
- 二零二五年度車輛掛靠運輸合同車輛運輸合同安全保障協(xié)議
- 二零二五年度個人租賃帶太陽能熱水系統(tǒng)住宅合同
- 二零二五年度餐飲行業(yè)知識產(chǎn)權保護協(xié)議
- 二零二五年度兼職攝影師聘用合同模板
- 家校共育之道
- DeepSeek入門寶典培訓課件
- 西安2025年陜西西安音樂學院專職輔導員招聘2人筆試歷年參考題庫附帶答案詳解
- 《作文中間技巧》課件
- 廣東省2025年中考物理仿真模擬卷(深圳)附答案
- 2025屆八省聯(lián)考 新高考適應性聯(lián)考英語試題(原卷版)
- 新蘇教版一年級下冊數(shù)學第1單元第3課時《8、7加幾》作業(yè)
- 2024年山東電力高等專科學校高職單招職業(yè)技能測驗歷年參考題庫(頻考版)含答案解析
- 2024年電力交易員(高級工)職業(yè)鑒定理論考試題庫(單選題、多選題、判斷題)
- 《平面廣告賞析》課件
- 【公開課】同一直線上二力的合成+課件+2024-2025學年+人教版(2024)初中物理八年級下冊+
評論
0/150
提交評論