日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
網(wǎng)絡(luò)端口地址轉(zhuǎn)換NAPT配置方法

本篇文章重點為大家講解一下網(wǎng)絡(luò)端口地址轉(zhuǎn)換 NAPT 配置方法,有需要的小伙伴可以參考一下。

成都創(chuàng)新互聯(lián)是一家專業(yè)提供瀘水企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站建設(shè)、成都網(wǎng)站制作、HTML5建站、小程序制作等業(yè)務(wù)。10年已為瀘水眾多企業(yè)、政府機構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站建設(shè)公司優(yōu)惠進行中。

實驗?zāi)康?/h4>

理解 NAT 網(wǎng)絡(luò)地址轉(zhuǎn)換的原理及功能 掌握 NAPT 的配置,實現(xiàn)局域網(wǎng)訪問互聯(lián)網(wǎng)

實驗背景

你是某公司的網(wǎng)絡(luò)管理員,公司辦公網(wǎng)需要接入互聯(lián)網(wǎng),公司只向 ISP 申請了一條專線,該專線分配了一個公司 IP 地址,配置實現(xiàn)全公司的主機都能訪問外網(wǎng)。

技術(shù)原理

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)一個全局地址)。 NAPT:使用不同的端口來映射多個內(nèi)網(wǎng) IP 地址到一個指定的外網(wǎng) IP 地址,多對一。 NAPT 采用端口多路復(fù)用方式。內(nèi)部網(wǎng)絡(luò)的所有主機均可共享一個合法外部 IP 地址實現(xiàn)對 Internet 的訪問,從而可以最大限度地節(jié)約 IP 地址資源。同時,又可隱藏網(wǎng)絡(luò)內(nèi)部的所有主機,有效避免來自 Internet 的攻擊。因此,目前網(wǎng)絡(luò)中應(yīng)用最多的就是端口多路復(fù)用方式。

ISP(Internet Service Provider),互聯(lián)網(wǎng)服務(wù)提供商,即向廣大用戶綜合提供互聯(lián)網(wǎng)接入業(yè)務(wù)、信息業(yè)務(wù)和增值業(yè)務(wù)的電信運營商。ISP是經(jīng)國家主管部門批準的正式運營企業(yè),享受國家法律保護。

實驗步驟

新建 Packet Tracer 拓撲圖

(1)R1 為公司出口路由器,其與 ISP 路由器之間通過 V.35 電纜串口連接,DCE 端連接在 R1 上,配置其時鐘頻率 64000; (2)配置 PC 機、服務(wù)器及路由器接口 IP 地址; (3)在各路由器上配置靜態(tài)路由協(xié)議,讓 PC 間能相互 Ping 通; (4)在 R1 上配置 NAPT。 (5)在 R1 上定義內(nèi)外網(wǎng)絡(luò)接口。 (6)驗證主機之間的互通性。

實驗設(shè)備

PC 2 臺;Server-PT 1 臺;Switch_2950-24 1 臺 Router-PT 2 臺;直通線;交叉線;DCE串口線

PC1

192.168.1.2
255.255.255.0
192.168.1.1

PC2

192.168.1.3
255.255.255.0
192.168.1.1

Server

200.1.2.2
255.255.255.0
200.1.2.1

R1

en
conf t
host R1
int fa 0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
int s 2/0
ip address 200.1.1.1 255.255.255.0
no shutdown
clock rate 64000

R2

en
conf t
host R2
int s 2/0
ip address 200.1.1.2 255.255.255.0
no shutdown
int fa 0/0
ip address 200.1.2.1 255.255.255.0
no shutdown

R1

exit
ip route 200.1.2.0 255.255.255.0 200.1.1.2

R2

exit
ip route 192.168.1.0 255.255.255.0 200.1.1.1
end
show ip route

PC1

CMD
ping 200.1.2.2 (success)

Web 瀏覽器
http://200.1.2.2 (success)

R1

int fa 0/0
ip nat inside
int s 2/0
ip nat outside
exit
access-list 1 permit 192.168.1.0 0.0.0.255
ip nat pool jaking 200.1.1.3 200.1.1.3 netmask 255.255.255.0 #設(shè)置名稱為jaking的地址池,起始和終止IP都是200.1.1.3
ip nat inside source list 1 pool jaking overload (無 overload 表示多對多,有 overload 表示多對一)
end
show ip nat translations(無結(jié)果)

PC1

Web 瀏覽器
http://200.1.2.2 (success)

R1

show ip nat translations(有 1 個結(jié)果)

PC2

Web 瀏覽器
http://200.1.2.2 (success)

R1

show ip nat translations(有 2 個結(jié)果)

實戰(zhàn)演練

R1

Continue with configuration dialog? [yes/no]: n


Press RETURN to get started!



Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host R1
R1(config)#int fa 0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1(config-if)#int s 2/0
R1(config-if)#ip add 200.1.1.1 255.255.255.0
R1(config-if)#no shut

%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(config-if)#clock rate 64000
R1(config-if)#

R2

Continue with configuration dialog? [yes/no]: n


Press RETURN to get started!



Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host R2
R2(config)#int s 2/0
R2(config-if)#ip add 200.1.1.2 255.255.255.0
R2(config-if)#no shut

%LINK-5-CHANGED: Interface Serial2/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up

R2(config-if)#int fa 0/0
R2(config-if)#ip add 200.1.2.1 255.255.255.0
R2(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config-if)#

R1

R1(config-if)#exit
R1(config)#ip route 200.1.2.0 255.255.255.0 200.1.1.2

R2

R2(config-if)#exit
R2(config)#ip route 192.168.1.0 255.255.255.0 200.1.1.1
R2(config)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#show ip route
Codes: 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 - OSPF external type 2, E - EGP
      i - 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 - ODR
      P - periodic downloaded static route

Gateway of last resort is not set

S    192.168.1.0/24 [1/0] via 200.1.1.1
C    200.1.1.0/24 is directly connected, Serial2/0
C    200.1.2.0/24 is directly connected, FastEthernet0/0

PC1

CMD
ping 200.1.2.2 (success)

PC>ipconfig

IP Address......................: 192.168.1.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1

PC>ping 200.1.2.2

Pinging 200.1.2.2 with 32 bytes of data:

Request timed out.
Reply from 200.1.2.2: bytes=32 time=24ms TTL=126
Reply from 200.1.2.2: bytes=32 time=25ms TTL=126
Reply from 200.1.2.2: bytes=32 time=20ms TTL=126

Ping statistics for 200.1.2.2:
   Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
   Minimum = 20ms, Maximum = 25ms, Average = 23ms

PC>ping 200.1.2.2

Pinging 200.1.2.2 with 32 bytes of data:

Reply from 200.1.2.2: bytes=32 time=25ms TTL=126
Reply from 200.1.2.2: bytes=32 time=20ms TTL=126
Reply from 200.1.2.2: bytes=32 time=23ms TTL=126
Reply from 200.1.2.2: bytes=32 time=25ms TTL=126

Ping statistics for 200.1.2.2:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 20ms, Maximum = 25ms, Average = 23ms

Web 瀏覽器 http://200.1.2.2 (success)

PC2

CMD
ping 200.1.2.2 (success)

PC>ipconfig

IP Address......................: 192.168.1.3
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1

PC>ping 200.1.2.2

Pinging 200.1.2.2 with 32 bytes of data:

Reply from 200.1.2.2: bytes=32 time=31ms TTL=126
Reply from 200.1.2.2: bytes=32 time=17ms TTL=126
Reply from 200.1.2.2: bytes=32 time=19ms TTL=126
Reply from 200.1.2.2: bytes=32 time=23ms TTL=126

Ping statistics for 200.1.2.2:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 17ms, Maximum = 31ms, Average = 22ms

Web 瀏覽器 http://200.1.2.2 (success)

R1

R1(config)#int fa 0/0
R1(config-if)#ip nat inside
R1(config-if)#int s 2/0
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)#ip nat pool jaking 200.1.1.3 200.1.1.3 netmask 255.255.255.0
R1(config)#ip nat inside source list 1 pool jaking overload
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#show ip nat translations
R1#


PC1

Web 瀏覽器
http://200.1.2.2 (success)

R1
show ip nat translations(有 1 個結(jié)果)

R1#show ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
tcp 200.1.1.3:1026     192.168.1.2:1026   200.1.2.2:80       200.1.2.2:80


PC2

Web 瀏覽器
http://200.1.2.2 (success)

R1
show ip nat translations(有 2 個結(jié)果)

R1#show ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
tcp 200.1.1.3:1026     192.168.1.2:1026   200.1.2.2:80       200.1.2.2:80
tcp 200.1.1.3:1024     192.168.1.3:1026   200.1.2.2:80       200.1.2.2:80

總結(jié)

至此,用思科模擬器進行網(wǎng)絡(luò)端口地址轉(zhuǎn)換 NAPT 配置完畢。


新聞名稱:網(wǎng)絡(luò)端口地址轉(zhuǎn)換NAPT配置方法
文章起源:http://www.5511xx.com/article/ccsschj.html