PAT端口多路復(fù)用(實(shí)踐)

拓?fù)浣Y(jié)構(gòu)圖

PAT端口多路復(fù)用(實(shí)踐)

十余年的澗西網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營(yíng)銷型網(wǎng)站建設(shè)的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整澗西建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“澗西網(wǎng)站設(shè)計(jì)”,“澗西網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。



第一步:配置交換機(jī)SW

sw#conf t
sw(config)#no ip routing            //關(guān)閉路由功能
sw(config)#int f1/0 
sw(config-if)#speed 100             //配置速率
sw(config-if)#dup full              //配置全雙工模式
sw(config-if)#ex

第二步:配置路由器R1,并設(shè)定PAT

R1#conf t
R1(config)#int f0/0
R1(config-if)#ip add 192.168.100.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0/1
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#access-list 1 permit 192.168.100.0 0.0.0.255
//定義內(nèi)部訪問列表
R1(config)#ip nat inside source list 1 interface fastEthernet 0/1 overload 
//設(shè)置復(fù)用動(dòng)態(tài)IP地址轉(zhuǎn)換于外部接口
R1(config)#int f0/0
R1(config-if)#ip nat inside     
R1(config-if)#int f0/1
R1(config-if)#ip nat outside
R1(config-if)#end

第三步:配置客戶機(jī)IP地址

PC1> ip 192.168.100.10 192.168.100.1
Checking for duplicate address...
PC1 : 192.168.100.10 255.255.255.0 gateway 192.168.100.1

PC2> ip 192.168.100.20 192.168.100.1
Checking for duplicate address...
PC1 : 192.168.100.20 255.255.255.0 gateway 192.168.100.1

PC3> ip 12.0.0.12 12.0.0.1
Checking for duplicate address...
PC1 : 12.0.0.12 255.255.255.0 gateway 12.0.0.1

第四步:測(cè)試全網(wǎng)互通,并使用debug 功能查看PAT過程

PC1> ping 12.0.0.12
84 bytes from 12.0.0.12 icmp_seq=1 ttl=63 time=31.242 ms
84 bytes from 12.0.0.12 icmp_seq=2 ttl=63 time=46.864 ms
84 bytes from 12.0.0.12 icmp_seq=3 ttl=63 time=31.280 ms
84 bytes from 12.0.0.12 icmp_seq=4 ttl=63 time=31.241 ms
84 bytes from 12.0.0.12 icmp_seq=5 ttl=63 time=31.241 ms

R1#debug ip nat
IP NAT debugging is on
R1#
*Mar  1 00:32:57.215: NAT*: s=192.168.100.10->12.0.0.1, d=12.0.0.12 [59174]
*Mar  1 00:32:57.219: NAT*: s=12.0.0.12, d=12.0.0.1->192.168.100.10 [59174]
...
//私網(wǎng)地址192.168.100.10已轉(zhuǎn)換成功公網(wǎng)地址12.0.0.1,并接收到來自公網(wǎng)主機(jī)的回復(fù)信息

PC2> ping 12.0.0.12
84 bytes from 12.0.0.12 icmp_seq=1 ttl=63 time=31.242 ms
84 bytes from 12.0.0.12 icmp_seq=2 ttl=63 time=31.245 ms
84 bytes from 12.0.0.12 icmp_seq=3 ttl=63 time=31.244 ms
84 bytes from 12.0.0.12 icmp_seq=4 ttl=63 time=31.213 ms
84 bytes from 12.0.0.12 icmp_seq=5 ttl=63 time=31.246 ms

R1#
*Mar  1 00:35:15.595: NAT*: s=192.168.100.20->12.0.0.1, d=12.0.0.12 [59312]
*Mar  1 00:35:15.607: NAT*: s=12.0.0.12, d=12.0.0.1->192.168.100.20 [59312]
...
////私網(wǎng)地址192.168.100.20已轉(zhuǎn)換成功公網(wǎng)地址12.0.0.1,并接收到來自公網(wǎng)主機(jī)的回復(fù)信息

小結(jié)

內(nèi)部地址外部地址
內(nèi)部局部地址 (端口) 內(nèi)部全局地址(端口)
外部局部地址 外部全局地址(端口)

PAT存在的意義

1.動(dòng)靜態(tài)NAT無法解決ip地址匱乏問題 (默認(rèn)一個(gè)私網(wǎng)IP地址對(duì)一個(gè)公網(wǎng)IP地址)
2.PAT卻可以解決ip地址匱乏(多個(gè)私網(wǎng)IP地址對(duì)一個(gè)公網(wǎng)IP地址)

名稱欄目:PAT端口多路復(fù)用(實(shí)踐)
標(biāo)題URL:http://bm7419.com/article40/igeceo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)響應(yīng)式網(wǎng)站、外貿(mào)網(wǎng)站建設(shè)、小程序開發(fā)、網(wǎng)站策劃用戶體驗(yàn)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計(jì)