计算机网络实验:实验六 利用NAT实现内部源地址转换

上传人:亦*** 文档编号:299203026 上传时间:2022-05-27 格式:DOCX 页数:10 大小:1.04MB
返回 下载 相关 举报
计算机网络实验:实验六 利用NAT实现内部源地址转换_第1页
第1页 / 共10页
计算机网络实验:实验六 利用NAT实现内部源地址转换_第2页
第2页 / 共10页
计算机网络实验:实验六 利用NAT实现内部源地址转换_第3页
第3页 / 共10页
计算机网络实验:实验六 利用NAT实现内部源地址转换_第4页
第4页 / 共10页
计算机网络实验:实验六 利用NAT实现内部源地址转换_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《计算机网络实验:实验六 利用NAT实现内部源地址转换》由会员分享,可在线阅读,更多相关《计算机网络实验:实验六 利用NAT实现内部源地址转换(10页珍藏版)》请在金锄头文库上搜索。

1、实验六 利用NAT实现内部源地址转换一、实验目的(1)掌握如何向外网发布内网的服务器(2)掌握NAT源地址转换和目的地址转换的区别二、应用背景网络地址转换NAT (Network Address Translation),能帮助解决IP地址资源紧缺的问题,而 且使得内外网隔离,提高一定的网络平安保障。NAT将网络划分为内部网络(inside)和外 部网络(outside)两局部。局域网主机利用NAT访问网络时,是将局域网内部的本地地址转 换为了全局地址(互联网合法IP地址)后转发数据包。NAT分为两种类型:网络地址转换NAT和网络地址端口转换NAPT (Network Address Port

2、 Translation) o NAT是实现转换后一个本地IP地址对应一个全局地址。NAPT是实现转换后多 个本地IP地址对应一个全局IP地址,并用不同的端口号进行区分。在传统的路由交换网络中可以使用路由器实现NAT转换,近年来大多使用防火墙来完成。使 用路由器实现NAT时,常常会发现路由器的性能下降,这是因为每一个经过路由器的数据包 都要进行NAT地址转换,这必然消耗系统的CPU资源,而且转换的中间结果还要暂时保存在 内存中以便于回应数据的恢复。防火墙的主要功能就是完成这种复杂任务,它的性能不像路 由器那样下降明显。本实验要实现内网网段的地址转换,假设只有50个公网地址,地址池是 200.1

3、.1.100/24-200.1.1.150/24,假设外网服务器地址为 。三、实验设备路由器R1762(2台),V.35线缆(1对),主机(2台),直连线或交叉线(1条)。四、实验拓扑第6步:在路由器R1上配置NATRl(config)#interface fastEthernet 1/0Rl(config-if)#ip nat inside!定义内部接口Rl(config-if)#exitRl(config)#interface serial 1/2Rl(config-if)#ip nat outside!定义夕卜部接口Rl(config-if)#exit!定义转换的地址池范围,并命名为ne

4、t50Rl(config)#access-list 1 !定义内部地址网段,使用ACI表示Rl(config)#ip nat inside source list 1 pool net50!定义内部源地址调用公网地址池第7步:在内网主机上翻开浏览器访问外部WWW服务器,输入 : 等地址;还可以访问FTP服务器,输入 ftp: 100.1.5.1 等。rjp-pco_* 一 = 回Physical Config Desktop第8步:查看配置 查看地址转换的情况Rl#show ip nat translations是 Routed)一 -=| 回 |STPhysical Config CLIIO

5、S Command Line InterfaceRouterRouteren Routertshow ip nat statistics Total translations: 27 (0 static, 27 dynamic, 27 extended) Outside Interfaces: SerialO/O/O Inside Interfaces: FastEthernetO/O Hits: 391 Misses: 121 Expired translations: 32 Dynamic mappings: Inside Source access-list 1 pool netSO r

6、efCount 3 pool netSO: netmask 255.255.255.0 start 200.1.1.100 end 200.1.1.150 type generic, total addresses 51 f allocated 1 (1%)r misses 0Router#|Copy Paste查看地址转换的统计情况第9步:路由R1上的参考配置五、实验步骤第1步:连线路由器R1和R2之间的串口,用V.35线缆连结;将内网主机和路由器R1的F1/0口相连;将另一台主机和R2的F1/0相连。第2步:配置网卡地址内网主机配置网卡地址为02.16.1.2/24,网关设为;外网服务器网

7、卡地址设为100.L1.5/16,网关设为。第3步:路由器的基本配置R1路由器的配置Rl(config)#RI (config)#interface FastEthernet 1/0RI (config-if)#no shutdownRI (config-if)#exitRI (config)#interface serial 1/2RI (config-if)#clockrate 64000RI (config-if)#no shutdownRI (config-if)#exitR2路由器的配置R2 (config)#interface fastEthernet 1/0R2 (config-

8、if)#no shutdownR2 (config-if)#exitR2 (config)#interface serial 1/2RI (config-if)#clockrate 64000R2 (config-if)#no shutdownR2 (config-if)#end查看RI的端口状态Rl#show ip interface brief查看R2的端口状态R2#show ip interface brief第4步:配置默认路由Rl(config)#ip route 0.0.0.0 0.0.0.0 R2不设置查看RI上的路由表Rl#show ip route甲 RouterOPhysi

9、cal Config CLIIOS Command Line InterfaceRouter(config)#Router(config)#Router(config)fexitRouter#%SYS-5-CONFIG_I: Configured from console by consoleRouter#Routertshow ip routeCodes: C - connected, S 一 static, I 一 工GRP, R - RIP, M 一 mobiler B - BGP D - E工GRP, EX - EIGRP external, O - OSPFr IA - OSPF i

10、nter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 El - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, LI - IS-IS level-lr L2 - IS-IS level-2, ia - IS-IS inter area * - candidate defaultr U - per-user static route, o - ODR P - periodic downloaded static rou

11、te172.16.0.0/24 is subnetted, 1 subnetsC172.16.1.0 is directly connected, FastEthernet0/0C 200.1.1.0/24 is directly connected, Serial0/0/0S* 0.0.0.0/0 1/0 via 200.1.1.2 Router#Copy Paste查看R2上的路由表R1762#show ip router RoutedA j 回Physical Config CLIIOS Command Line InterfaceSerialO/O/OYES manual upupVl

12、anlunassignedYES manual administratively down down% Invalid input detected at * * * marker.Router#Routertahow ip routeCodes: C 一 connected, S 一 static, I -工GRP, R - RIP, M - mobile, B - BGP D - E工GRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA

13、external type 2 El - OSPF external type lr E2 - OSPF external type 2, E - EGP i - IS-ISr LI - IS-IS level-lr L2 - IS-IS level-2r ia - IS-IS inter area * 一 candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is not get100.0.0.0/24 is subnet

14、ted, 1 subnetsC100.1.1.0 is directly connected, FastEthernet0/0三C200.1.1.0/24 is directly connected, Serial0/0/0Rout;ert|Copy Paste第5步:验证网络的连通性从内网主机开始,由近及远分别ping以下地址:(1) Pinging 172.16.1.1 with 32 bytes of data:Reply from 172.16.1.1:Reply from 172.16.1.1:Reply from 172.16.1.1:Reply from 172.16.1.1:b

15、ytes=32 time=41m3 TTL=255byte3=32bytea=32bytes=32time=5ms time=Sm3 time=3m3TTL=255TTL=255TTL=255Ping statistics for 172.16.1.1:Packers: Sent =4, Received = 4, Lost = 0 (0% loss), proximate round trip times in milli-seconds:Minimum = 3ms, Maximum = 41mar Average = 13msPinging 200.1.1.1 with 32 bytes of data:from 200.1.1.1:time=3msTTL=255from 200.1.1.1:time=5msTTL=255from 200.1.1.1:time=2msTTL=255from 200.1.1.1:time=4msTTL=255ReplyReply Reply Replybytes=32 bytea=32bytea=32byte3=32Ping szazszcs for 200.1

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号