实验二十九 配置静态NAT
【实验名称】
配置静态NAT 。
【实验目的】
配置网络地址变换,提供到公司共享服务器的可靠外部访问。
【背景描述】
某IT 企业因业务扩展,需要升级网络,他们选择172.16.1.0/24作为私有地址,并用NAT 来处理和外部网络的连接。
【需求分析】
公司需要将172.16.1.5和172.16.1.6两台主机作为共享服务器,需要外网能够访问,考虑到包括安全在内的诸多因素,公司希望对外部隐藏内部网络。
【实验】 1.1 实验设备
用户自定义路由器2621XM 2台 交换机2950-24 1台 PC 机 2台
1.2 组网图
S0/0S0/0
F0/0
PC3
F0/0
1.3 设备IP 地址表
【实验原理】
在路由器RT3上把通过NAT地址转换,将172.16.4.2、172.16.4.3两台主机访问互联网的行为转
换成路由器RT3上220.1.1.2访问互联网的行为,从而实现把内网隐藏起来。
1.4 配置步骤
第一步在路由器上RT1配置IP路由选择和IP地址。
RT1#config t
RT1(config)#interface FastEthernet 0/0
RT1(config-if) #ip address 210.1.1.1 255.255.255.252
RT1(config)#interface FastEthernet 0/1
RT1(config-if) #ip address 202.101.172.1 255.255.255.0 RT1(config)#ip route 0.0.0.0 0.0.0.0 FastEthernet 0/1
第二步在路由器上RT2配置IP路由选择和IP地址。
RT2#config t
RT2(config)#interface FastEthernet 0/0
RT2(config-if) #ip address 210.1.1.2 255.255.255.252
RT2(config)#interface serial 0/0
RT2(config-if) #clock rate 64000
RT2(config-if) #ip address 220.1.1.1 255.255.255.0
RT2(config)#ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0
第三步在路由器上RT3配置IP路由选择和IP地址。
RT3#config t
RT3(config)#interface FastEthernet 0/0
RT3(config-if) #ip address 172.16.4.1 255.255.255.252
RT3(config)#interface serial 0/0
RT3(config-if) #clock rate 64000
RT3(config-if) #ip address 220.1.1.2 255.255.255.0
RT3(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0
第四步在路由器RT3上配置静态NAT。
RG(config)#ip nat inside source static 172.16.4.2 220.1.1.2 RG(config)#ip nat inside source static 172.16.4.3 220.1.1.2 第五步在路由器RT3上指定一个内部接口和一个外部接口。
RT3(config)#interface serial 0/0
RT3(config-if)#ip nat outside
RT3(config)#interface FastEthernet 0/0
RT3(config-if)#ip nat inside
第六步在RT3上查看地址转换的情况
先从内网PING 外网计算机,再查看地址转换情况
Router#show ip nat translations
1.5 验证配置
1、主机PC1通过PING 命令PING主机PC3截图保存在PKT文件中。
2、RT3上对主机PC1通过PING 命令PING主机PC3时进行的地址转换
3、主机PC2通过PING 命令PING主机PC3截图保存在PKT文件中。
4、RT3上对主机PC2通过PING 命令PING主机PC3时进行的地址转换
5、主机PC3通过PING 命令PING主机PC1(或PC2)截图保存在PKT文件中。