ZUCC_计算机网络实验_实验08 NAT地址转换
作者:互联网
浙江大学城市学院实验报告
文件下载:https://download.csdn.net/download/OwemShu/83603459
一、实验目的
- 掌握动态NAT的作用和原理;
- 掌握NAPT/PAT的作用和原理。
二、实验设备
Cisco 2911路由器,PC机,服务器,2960交换机,双绞线若干。
三、实验步骤
1、动态NAT实验
根据以下拓扑图和IP地址,进行NAT配置实验
序号 | 设备 | 接口 | IP地址 | 子网掩码 |
---|---|---|---|---|
1 | R0 | G0/0 | 218.18.18.1 | 255.255.255.0/24 |
G0/1 | 172.30.1.1 | 255.255.255.0/24 | ||
2 | G0/2 | 172.16.1.1 | 255.255.255.0/24 | |
3 | R1 | G0/0 | 218.18.18.2 | 255.255.255.0/24 |
5 | PC0 | 172.16.1.10 | 255.255.255.0/24 | |
6 | PC1 | 172.16.1.20 | 255.255.255.0/24 | |
7 | PC2 | 172.30.1.10 | 255.255.255.0/24 |
1.1 拓扑图截图:
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
从PC1到路由器端口218.18.18.2
从PC2到路由器端口218.18.18.2
1.5 NAT转换信息截图
1.6 NAT统计信息截图
2. NAPT/PAT****实验
请将Route0的名字改成自己姓名的缩写
2.1 拓扑图截图如下:
2.2 填写下表
序号 | 设备 | 接口 | IP****地址 | 子网掩码 |
---|---|---|---|---|
1 | R0 | G0/0 | 200.16.16.1/24 | 255.255.255.0/24 |
2 | R0 | G0/1 | 172.16.0.1/24 | 255.255.255.0/24 |
3 | R1 | G0/0 | 200.16.16.2/24 | 255.255.255.0/24 |
4 | R1 | G0/1 | 199.19.19.1/24 | 255.255.255.0/24 |
5 | PC0 | 172.16.0.10/24 | 255.255.255.0/24 | |
6 | PC1 | 172.16.0.20/24 | 255.255.255.0/24 | |
7 | Server0 | 172.16.0.100/24 | 255.255.255.0/24 | |
8 | Server1 | 199.19.19.100/24 | 255.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页面上显示本人的姓名和学号。
标签:R0,255.255,SHX,ip,08,ZUCC,实验,255.0,config 来源: https://blog.csdn.net/OwemShu/article/details/123307623