? ? ? ? ? ? ? ? ? ? ? ? ? ? 安徽工業(yè)經(jīng)濟職業(yè)技術(shù)學(xué)院
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 計算機與藝術(shù)學(xué)院 ? ? ? ? ? ? ? ? 31715 ? ?17#303
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?動態(tài)NET地址轉(zhuǎn)換配置
實驗名稱:動態(tài)NET配置
實驗?zāi)康模?/b>掌握動態(tài)NET的配置方法
要求:PC1可以訪問外網(wǎng),而其他網(wǎng)絡(luò)設(shè)備不能訪問外網(wǎng)!
實驗原理:當私有網(wǎng)主機和公共網(wǎng)主機通信的IP包經(jīng)過NAT網(wǎng)關(guān)時,將IP包中的源IP或目的IP在私有IP和NAT的公共IP之間進行轉(zhuǎn)換。
實驗拓撲:

實驗步驟:
1、路由器的IP配置(R1為例)
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#interface f0/1
R1(config-if)#ip address 10.0.1.1255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#ex
R1(config)#interface f0/0
R1(config-if)#ip address 10.0.2.1255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#ex
R1(config)#interface e1/0
R1(config-if)#ip address 20.0.0.1255.255.255.0
R1(config-if)#no shutdown
2、OSPF路由協(xié)議(以R1為例)
R1(config)#interface s1/0
R1(config-if)#clock rate 64000
R1(config-if)#ex
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 10.0.1.00.0.0.255 area 100
R1(config-router)#network 10.0.2.00.0.0.255 area 100
R1(config-router)#network 20.0.0.10.0.0.255 area 100
(1.1.1.1代表R1的專屬ID????? 公布網(wǎng)絡(luò)時需要指明所屬區(qū)域)
3、R1.R2配置默認路由
R1(config)#ip rou 0.0.0.0 0.0.0.0 20.0.0.2
4、動態(tài)NET地址配置
R2(config)#ip nat pool zhang 30.0.0.1030.0.0.20 ne
R2(config)#ip nat pool zhang 30.0.0.1030.0.0.20 netmask 255.255.255.0
R2(config)#access-list 1 permit 10.0.1.00.0.0.255
R2(config)#ip nat inside source list 1 poolzhang
R2(config)#interface s1/1
R2(config-if)#ip nat inside
R2(config-if)#ex
R2(config)#interface s1/0
R2(config-if)#ip nat outside
5、查看轉(zhuǎn)換映射記錄
R2#sh ip nat translations
Pro?Inside global???? Insidelocal?????? Outside local????? Outside global
icmp 30.0.0.10:21????? 10.0.1.1:21??????? 40.0.0.1:21??????? 40.0.0.1:21
icmp 30.0.0.10:22????? 10.0.1.1:22??????? 40.0.0.1:22??????? 40.0.0.1:22
icmp 30.0.0.10:23????? 10.0.1.1:23??????? 40.0.0.1:23??????? 40.0.0.1:23
icmp 30.0.0.10:24????? 10.0.1.1:24?????? ?40.0.0.1:24??????? 40.0.0.1:4