资源描述
计算机网络构建实验报告
实验组号: 课程: 班级:
实验名称:
姓 名__________ 实 验 日 期:
学 号_____________ 实验报告日期:
同组人姓名_________________ 报 告 退 发: ( 订正 、 重做 )
同组人学号_ ______ _________________ 教 师 审 批 签 字:通过 不通过
实验10-1 内部源地址静态转换NAT
【实验名称】
静态内部源地址转换NAT。
【实验目的】
掌握内网中一台服务器连接到Internet网时的静态内部源地址转换。
【背景描述】
你是某公司的网络管理员,内部网络有WEB/FTP可以为外部用户提供的服务,服务器的IP地址必须采用静态地址转换,以便外部用户可以使用这些服务。
【实现功能】
一个企业不想让外部网络用户知道自己的网络内部结构,可以通过NAT将内部网络与外部Internet隔离开,则外部用户根本不知道通过NAT设置的内部IP地址。
【实验拓扑】
OL IP:192.1.2.1
OG IP: 192.1.1.2
IG IP: 192.1.1.1
IL IP: 192.168.2.1
F1/0
PC1
PC2
S1/2
S1/2
F1/0
NAT
WEB server IP: 192.168.2.2
XP客户机IP:192.168.2.3
客户IP:192.1.2.2
R2(WAN_ ROUTER)
R1(LAN_ ROUTER)
【实验设备】 R1762 (2台) 计算机2台
【实验步骤】先在PC1的虚拟机上建立WEB服务。
步骤1. 基本配置。
Red-Giant (config) #hostname R1
R1 (config) #interface serial 1/2
R1 (config-if) #ip address 192.1.1.1 255.255.255.0
R1 (config-if) #clock rate 64000
R1 (config-if) #no shutdown
R1 (config-if) #end
R1 (config) #interface fastEthernet 1/0
R1 (config-if) #ip add 192.168.2.1 255.255.255.0
R1 (config-if) #no sh
R1 (config-if) #exit
R1 (config) #ip route 0.0.0.0 0.0.0.0 serial 1/2
Red-Giant (config) #hostname R2
R2 (config) #int serial 1/2
R2 (config-if) #ip address 192.1.1.2 255.255.255.0
R2 (config-if) #no sh
R2 (config-if) #interface fastEthernet 1/0
R2 (config-if) # ip add 192.1.2.1 255.255.255.0
R2 (config-if) #no sh
验证测试:R2#ping 192.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echose to 192.1.1.1, timeout is 2 seconds:
!!!!!
[记录实验结果]
验证测试:R1#ping 192.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echose to 192.1.1.1, timeout is 2 seconds:
!!!!!
[记录实验结果]
验证测试:R2#ping 192.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echose to 192.1.1.1, timeout is 2 seconds:
!!!!!
[记录实验结果]
步骤2. 配置静态NAT映射。
R1 (config) #ip nat inside source static 192.168.2.2 192.1.1.3 !定义静态映射一一匹配
R1 (config) #int fastEthernet 1/0
R1 (config-if) #ip nat inside !定义内部接口
R1 (config) #int serial 1/2
R1 (config-if) #ip nat outside !定义外部接口
[记录实验结果]
验证测试1:在PC2上PING测试到PC1端的网络连通性:
PING 192.168.2.2时发现不能ping通。
[记录实验结果]
PING 192.1.1.1时发现可以PING通。
[记录实验结果]
PING 192.1.1.3时也可以PING通。
[记录实验结果]
在PC1上PING测试到PC2端的网络连通性:
PING 192.168.2.1时发现能ping通。
[记录实验结果]
PING 192.1.1.1时发现可以PING通。
[记录实验结果]
PING 192.1.1.2 时发现不可以PING通。
[记录实验结果]
验证测试2: 从外网主机PC2上访问内网PC1上的WEB服务器。在PC2客户机的IE浏览器地址栏中直接使用 httP://192.1.1.3 直接访问WEB服务器的主页。
特别注意:测试之前先关闭PC1计算机的独立网卡,关闭独立网卡之前一定要先关闭路由器配置窗口(CLI界面),然后检查调整好虚拟机上的TCP/IP配置,如果服务器IP地址无效,可以使用“先禁用后启用”网卡的操作,确保服务器主机地址192.168.2.2/24可用。
[记录实验结果]
验证测试3: 在lan-router上使用show命令查看地址转换关系。
R1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
tcp 192.1.1.3:80 192.168.2.2:80 192.1.2.2:1123 192.1.2.2:1123
注意:当执行show命令后,如果没有看到下面的地址转换关系,可以在PC2上重新打开IE浏览器访问WEB服务器,或者刷新WEB页面,然后再次使用show命令,正常情况下就会看到地址转换的关系列表。
[记录实验结果]
【注意事项】
↘ 不要把inside和outside应用的接口弄错;
↘ 要加上能使数据包向外转发的路由,比如默认路由;
↘ 尽量不要用广域网接口地址作为映射的全局地址。
【参考配置】
R1#sh run
Current configuration:
!
version 6.14(2)
!
hostname “R1”
!
ip subnet-zero
!
interface FastEthernet 0
ip address 192.168.1.1 255.255.255.0
ip nat inside
!
interface FastEthernet 1
no ip address
shutdown
!
interface FastEthernet 2
no ip address
shutdown
!
interface FastEthernet 3
no ip address
shutdown
!
interface Serial 0
ip address 192.1.1.1 255.255.255.0
ip nat outside
clock rate 64000
!
interface Serial 1
no ip address
shutdown
! ip nat inside source static 192.168.1.2 192.1.1.3
ip classless
ip route 0.0.0.0 0.0.0.0 Serial 0
!
line con 0
line aux 0
line vty 0 4
login
!
end
展开阅读全文