教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 范文大全 > 行业范文 >

PacketTracer网络地址转换NAT配置实验

来源:网络收集 时间:2026-02-12
导读: 网络地址转换NAT配置 一、实验目标 理解NAT网络地址转换的原理及功能; 掌握静态NAT的配置,实现局域网访问互联网; 二、实验背景 公司欲发布WWW服务,现要求将内网Web服务器IP地址映射为全局IP地址,实现外部网络可访问公司内部Web服务器。 三、技术原理 网

网络地址转换NAT配置 一、实验目标

理解NAT网络地址转换的原理及功能; 掌握静态NAT的配置,实现局域网访问互联网;

二、实验背景

公司欲发布WWW服务,现要求将内网Web服务器IP地址映射为全局IP地址,实现外部网络可访问公司内部Web服务器。 三、技术原理 网络地址转换NAT(Network Address Translation),被广泛应用于各种类型Internet接入方式和各种类型的网络中。原因很简单,NAT不仅完美解决了IP地址不足的问题,而且还能够有效地避免来自网络外部的攻击,隐藏并保护网络内部的计算机。

默认情况下,内部IP地址是无法被路由到外网的,内部主机10.1.1.1要与外部internet通信,IP包到达NAT路由器时,IP包头的源地址10.1.1.1被替换成一个合法的外网IP,并在NAT转换表中保存这条记录。当外部主机发送一个应答到内网时,NAT路由器收到后,查看当前NAT转换表,用10.1.1.1替换掉这个外网地址。

NAT将网络划分为内部网络和外部网络两部分,局域网主机利用NAT访问网络时,是将局域网内部的本地地址转换为全局地址(互联网合法的IP地址)后转发数据包。 NAT分为两种类型:NAT(网络地址转换)和NAPT(网络端口地址转换IP地址对应一个全局地址)。

静态NAT:实现内部地址与外部地址一对一的映射。现实中,一般都用于服务器; 动态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>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#int fa0/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)#exit

R1(config)#int s2/0

R1(config-if)#ip add 222.0.1.1 255.255.255.0

R1(config-if)#no shut

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

R1(config-if)#

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

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

R1(config-if)#

R1(config-if)#

R1(config-if)#exit

R1(config)#ip route 222.0.2.0 255.255.255.0 222.0.1.2 //配置到222.0.2.0网段的静态路由 R1(config)#end

R1#

%SYS-5-CONFIG_I: Configured from console by console

R1#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

C 192.168.1.0/24 is directly connected, FastEthernet0/0

C 222.0.1.0/24 is directly connected, Serial2/0

S 222.0.2.0/24 [1/0] via 222.0.1.2

R1#

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#int fa0/0

R1(config-if)#?

arp Set arp type (arpa, probe, snap) or timeout

bandwidth Set 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 interface 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

priority-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 name

R1(config-if)#ip ?

access-group Specify access control 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 interface commands

split-horizon Perform split horizon

summary-address Perform address summarization

virtual-reassembly Virtual Reassembly

R1(config-if)#ip nat ?

inside Inside interface for address translation

outside Outside interface for address translation

R1(config-if)#ip nat inside ?

<cr>

R1(config-if)#ip nat inside

R1(config-if)#exit

R1(config)#int s2/0

R1(config-if)#ip nat outside ?

<cr>

R1(config-if)#ip nat outside

R1(config-if)#exit

R1(config)#

R1#

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#ip ?

access-list …… 此处隐藏:6880字,全部文档内容请下载后查看。喜欢就下载吧 ……

PacketTracer网络地址转换NAT配置实验.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/fanwen/981613.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)