PacketTracer网络地址转换NAT配置实验_第1页
PacketTracer网络地址转换NAT配置实验_第2页
PacketTracer网络地址转换NAT配置实验_第3页
PacketTracer网络地址转换NAT配置实验_第4页
PacketTracer网络地址转换NAT配置实验_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、网络地址转换NAT配置一、实验目标· 理解NAT网络地址转换的原理及功能;· 掌握静态NAT的配置,实现局域网访问互联网;二、实验背景公司欲发布WWW服务,现要求将内网Web服务器IP地址映射为全局IP地址,实现外部网络可访问公司内部Web服务器。三、技术原理· 网络地址转换NAT(Network Address Translation),被广泛应用于各种类型Internet接入方式和各种类型的网络中。原因很简单,NAT不仅完美解决了IP地址不足的问题,而且还能够有效地避免来自网络外部的攻击,隐藏并保护网络内部的计算机。· 默认情况下,内部IP地址是无法

2、被路由到外网的,内部主机.1要与外部internet通信,IP包到达NAT路由器时,IP包头的源地址被替换成一个合法的外网IP,并在NAT转换表中保存这条记录。当外部主机发送一个应答到内网时,NAT路由器收到后,查看当前NAT转换表,用替换掉这个外网地址。· NAT将网络划分为内部网络和外部网络两部分,局域网主机利用NAT访问网络时,是将局域网内部的本地地址转换为全局地址(互联网合法的IP地址)后转发数据包。· NAT分为两种类型:NAT(网络地址转换)和NAPT(网络端口地址转换IP地址对应一个全局地址)。· 静态NAT:实现内部

3、地址与外部地址一对一的映射。现实中,一般都用于服务器;· 动态NAT:定义一个地址池,自动映射,也是一对一的。现实中,用得比较少;· NAPT:使用不同的端口来映射多个内网IP地址到一个指定的外网IP地址,多对一。四、实验步骤实验拓扑1、R1为公司出口路由器,其与外部路由之间通过V.35电缆串口连接,DCE端连接在R2上,配置其时钟频率为64000;2、配置PC机、服务器及路由器接口IP地址;3、在各路由器上配置静态路由协议,让PC间能相互ping通;4、在R1上配置静态NAT;5、在R1上定义内外部网络接口;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 /配置到网段的静态路由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 /配置内网到外网的静态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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论