【www.scfx8.com--述职述廉报告】

IP 通信基础实验报告 e NAT outside to inside 实验 一、 实验目的 1、 掌握 NAT 的数据配置方法; 2、 理解和巩固 NAT 的基本原理; 二、 实验内容(仿真程序‘ NAT_ out side to in side.pkt ’) 一台 路由器和通过二层交换机与服务器相连,作为内网,通过配置,映射成外网地址,达到互连的目的。

实验设备 路由器 2 台 PC 机 1 台 交叉网线 2 条 直通网线 2 条 二层交换机 1 台 服务器 1 台 四、 实验拓扑图

五、 配置步骤 先必须配置主机 B A, B 的 的 P IP 地址; ==== 底层配置 RT1 Continue with configuration dialog? [yes/no]: no Press RETURN to get started! Router>enable Router#conf t

Router(config)#hostname RT1 Enter configuration commands, one per line. End with CNTL/Z. RT1(config)#interface fastEthernet 0/0 RT1(config- - if)#no shutdown %LINK- -5 5- - CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO- -5 5- - UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up RT1(config- - if)#ip address 12.1 2.12.254 255.255.255.0 RT1(config- - if)#exit RT1(config)#interface fastEthernet 1/0 RT1(config- - if)#no shutdown RT1(config- - if)#ip address 23.23.23.1 255.255.255.0 RT1(config- - if)#exit RT1(config)# RT2===================================================

======= == Continue with configuration dialog? [yes/no]: no Press RETURN to get started! Router>enable Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname RT2 RT2(config)#interface fastEthernet 1/0 RT2(config- -i i f)#no shutdown %LINK- -5 5- - CHANGED: Interface FastEthernet1/0, changed state to up %LINEPROTO- -5 5- - UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

RT2(config- - if)#ip address 23.23.23.2 255.255.255.0 RT2(config- - if)#exit RT2(config)#interf ace fastEthernet 0/0 RT2(config- - if)#no shutdown %LINK- -5 5- - CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO- -5 5- - UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up RT2(config- - if)#ip address 192.168.10.254 255.255.255.0 R R T2(config- - if)#exit RT2(config)# ==== 配置静态路由 RT1 RT1(config)#ip route 192.168.10.0 255.255.255.0 23.23.23.2 // 注意,这一条指令不需要,因为外网看不到内网

RT2 RT2(config)#ip route 12.12.12.0 255.255.255.0 23.23.23.1 ==== 配置 NAT RT2 RT2(config)#interface fastEthernet 0/0==== 指明该端口是对内的端口 RT2(config- - if)#ip nat insi de RT2(config- - if)#exit RT2(config)#interface fastEthernet 1/0==== 指明该端口是对外的端口 RT2(config- - if)#ip nat outside RT2(config- - if)#exit RT2(config)#ip nat inside source static 192.168.10.1 23.23.23.3==== 配置端口映射,指明外界对 3 23.23.23.3 的访问被静态的转换到内网 1 192.168.10.1 上

六、 验证方法及验证结果 1. 此时 ,可在 2 RT2 全局模式下使用“ show ip nat translations” ” 查看 T NAT 结果,如下 图上部分 :

2. 用主机 1 PC1 去 去 g ping 服务器 P IP 地址 23.23.23.3 ,再使用“ do show ip nat translations ”查看 T NAT 结果,如下 图下部分:

所示:

本文来源:http://www.scfx8.com/shuzhibaogao/74106.html