其他分享
首页 > 其他分享> > ZUCC_计算机网络实验_实验08 NAT地址转换

ZUCC_计算机网络实验_实验08 NAT地址转换

作者:互联网

浙江大学城市学院实验报告

文件下载:https://download.csdn.net/download/OwemShu/83603459

一、实验目的

  1. 掌握动态NAT的作用和原理;
  2. 掌握NAPT/PAT的作用和原理。

二、实验设备

Cisco 2911路由器,PC机,服务器,2960交换机,双绞线若干。

三、实验步骤

1、动态NAT实验

根据以下拓扑图和IP地址,进行NAT配置实验

image-20220306111108931

序号设备接口IP地址子网掩码
1R0G0/0218.18.18.1255.255.255.0/24
G0/1172.30.1.1255.255.255.0/24
2G0/2172.16.1.1255.255.255.0/24
3R1G0/0218.18.18.2255.255.255.0/24
5PC0172.16.1.10255.255.255.0/24
6PC1172.16.1.20255.255.255.0/24
7PC2172.30.1.10255.255.255.0/24

1.1 拓扑图截图:

image-20220306111327874

1.2 路由器R0的配置

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R0
R0(config)#int g0/0
R0(config-if)#ip add 218.18.18.1 255.255.255.0
R0(config-if)#ip nat outside
R0(config-if)#no sh

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

R0(config-if)#int g0/1
R0(config-if)#ip add 172.30.1.1 255.255.255.0
R0(config-if)#ip nat inside
R0(config-if)#no sh

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

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

R0(config-if)#int g0/2
R0(config-if)#ip add 172.16.1.1 255.255.255.0
R0(config-if)#ip nat inside
R0(config-if)#no sh

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up

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

R0(config-if)#exit
R0(config)#access-list 1 permit 172.0.0.0 0.0.0.255
R0(config)#ip nat pool TEST_POOL 218.18.18.10 218.18.18.20 netmask 255.255.255.0
R0(config)#ip nat inside source list 1 pool TEST_POOL

1.3路由器R1的配置

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int g0/0
R1(config-if)#ip add 218.18.18.2 255.255.255.0
R1(config-if)#no sh

R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

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

1.4 测试可达性

从PC0到路由器端口218.18.18.2

image-20220306112006417

从PC1到路由器端口218.18.18.2

image-20220306112020144

从PC2到路由器端口218.18.18.2

image-20220306112033230

1.5 NAT转换信息截图

1.6 NAT统计信息截图

2. NAPT/PAT****实验

image-20220306112145249

请将Route0的名字改成自己姓名的缩写

2.1 拓扑图截图如下:

2.2 填写下表

序号设备接口IP****地址子网掩码
1R0G0/0200.16.16.1/24255.255.255.0/24
2R0G0/1172.16.0.1/24255.255.255.0/24
3R1G0/0200.16.16.2/24255.255.255.0/24
4R1G0/1199.19.19.1/24255.255.255.0/24
5PC0172.16.0.10/24255.255.255.0/24
6PC1172.16.0.20/24255.255.255.0/24
7Server0172.16.0.100/24255.255.255.0/24
8Server1199.19.19.100/24255.255.255.0/24

2.3 路由器R0的配置

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname SHX
SHX(config)#int g0/1
SHX(config-if)#ip add 172.16.0.1 255.255.255.0
SHX(config-if)#ip nat inside
SHX(config-if)#no sh

SHX(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

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

SHX(config-if)#int g0/0
SHX(config-if)#ip add 200.16.16.1 255.255.255.0
SHX(config-if)#ip nat outside
SHX(config-if)#no sh

SHX(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

SHX(config-if)#exit
SHX(config)#ip route 0.0.0.0 0.0.0.0 200.16.16.2
SHX(config)#access-list 1 permit 172.16.0.0 0.0.255.255
SHX(config)#ip nat pool TEST_POOL 200.16.16.10 200.16.16.10 netmask 255.255.255.0
SHX(config)#ip nat inside source list 1 pool TEST_POOL overload
SHX(config)#ip nat inside source static tcp 172.16.0.100 80 200.16.16.100 80
SHX(config)#exit

2.4 路由器R1的配置


Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int g0/1
R1(config-if)#ip add 199.19.19.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

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

R1(config-if)#exit
R1(config)#int g0/0
R1(config-if)#ip add 200.16.16.2 255.255.255.0
R1(config-if)#no sh

R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

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

2.5 从内网PC0访问外网的FTP服务器Server1

2.6 从外网的Server1,通过浏览器访问内网的Web服务器Server0,请在Web页面上显示本人的姓名和学号。

image-20220306112533978

标签:R0,255.255,SHX,ip,08,ZUCC,实验,255.0,config
来源: https://blog.csdn.net/OwemShu/article/details/123307623