当前位置:网站首页>NAT network address translation protocol topology experiment
NAT network address translation protocol topology experiment
2022-07-27 02:31:00 【m0_ seventy-two million five hundred and eighty-six thousand an】
Catalog
Two 、 The experimental requirements
1.PC1 and PC2 Automatically assigned ip Address
2. Connect intranet and extranet
3. Use port mapping to connect to intranet server
2. Router 、 The server 、Client1 Configuration of
3. Static routing and one to many configuration
4. Content configuration of server information
5. Port mapping connection Client1 And intranet services
One 、 The experiment purpose
adopt NAT The network address translation protocol enables the topology environment shown in the figure below to meet the experimental requirements

Two 、 The experimental requirements
1.AR2 by ISP equipment ,AR1-AR2 Manually configure on the device ip Address ,PC1 and PC2 by DHCP Automatically assigned ip Address ;
2.1.1.1.0/24 Network segment represents the whole Internet ( Extranet ) All network segments ;
3.PC1 It's ok ping through PC2;
4.AR1 Only one public ip Address , stay GE0/0/1 On the interface ;
5.Client1 Can pass http Visit two sever
6.Client1 Visiting one of them server Access through domain name resolution ;
3、 ... and 、 Demand analysis
1.PC1 and PC2 Automatically assigned ip Address :
PC1 and PC2 Respectively belong to AR1 and AR2 Different network segments of the router , Turn on the two routers separately DHCP Dynamic Host Configuration Protocol , And set up a system named a Of ip Address pond , With AR1 Of GE0/0/0 Interface distribution IP by 192.168.1.0/24 The address of , With AR2 Of GE0/0/1 Interface distribution IP by 1.1.1.0/24 The address of ;
2. Connect intranet and extranet :
In this topology environment , First give AR1 add to 1.1.1.0/24 Static route of road segment , Then use NAT Network address translation protocol , Will source ip Address pc1 Convert to AR Interface GE0/0/1 The address of , Re pass AR1 Of GE0/0/1 Interface address to access the Internet , So that we can PC1ping through PC;
3. Use port mapping to connect to intranet server :
Need to let Client1 adopt http Access to two servers in the intranet , The two servers in the intranet need to be modified to http The server , And through NAT The port mapping of the protocol is established Client1 Contact with intranet ; That is, the server interface is accessed externally and the target port number is 80 when , Will be modified to AR1 Of GE0/0/1 The target port of 80;
4. establish DNS The server :
If you want to Client1 Access two computers in the intranet through domain name resolution html One of the servers , It is necessary to establish DNS Domain name resolution server , And add ip Address and the host domain name you want to name ; Because the traffic accessing the intranet interface has passed NAT The network address translation protocol translates from AR1 Of GE0/0/1 The interface enters the intranet , therefore DNS The domain name added by the server ip The address is AR1 Of GE0/0/1 Interface ip Address ;
Four 、 The experimental steps
1. Change the router name :
With AR1 For example :
[Huawei]sysname r1
[r1]

2. Router 、 The server 、Client1 Configuration of :
1) Router :
①AR1:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.1.1.1 24

[r1]dhcp enable
[r1-ip-pool-a]network 192.168.1.0 mask 255.255.255.0
[r1-ip-pool-a]gateway-list 192.168.1.1
[r1-ip-pool-a]dns-list 114.114.114.114 8.8.8.8
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global

②AR2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r2]interface g0/0/1
[r2-GigabitEthernet0/0/1]ip address 1.1.1.1 24

[r2]dhcp enable
[r2]ip pool a
[r2-ip-pool-a]network 1.1.1.0 mask 255.255.255.0
[r2-ip-pool-a]gateway-list 1.1.1.1
[r2-ip-pool-a]dns-list 114.114.114.114 8.8.8.8

[r2-GigabitEthernet0/0/1]dhcp select global

2) The server :
①Server1(Http):
Native address :192.168.1.2
Subnet mask :255.255.255.0
gateway :192.168.1.1
②Server2(Http):
Native address :192.168.1.3
Subnet mask :255.255.255.0
gateway :192.168.1.1
③Server3(DNS):
Native address :1.1.1.4
Subnet mask :255.255.255.0
gateway :1.1.1.1
3)Cilent:
Native address :1.1.1.2
Subnet mask :255.255.255.0
gateway :1.1.1.1
Domain name server :1.1.1.4
3. Static routing and one to many configuration :
AR1:
[r1]ip route-static 1.1.1.0 24 12.1.1.2
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]nat outbound 2000


4. Content configuration of server information :
1)Http The server (Server1、Server2)


2)DNS The server (Server3)
add to ip The address is 12.1.1.1, The host domain name is www.eren.com

5. Port mapping connection Client1 And two servers on the intranet :
stay AR1 Of GE0/0/1 Port mapping configuration ; Will visit 80 The traffic of the port number points to Server1, Will visit 8888 The traffic of the port number points to Server2;
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 80 inside 192.168.1.2 80
[r1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 8888 inside 192.168.1.3 80

5、 ... and 、 Results test :
1)PC1ping through PC2
By adjusting the terminal to DHCP Automatically assigned ipv4 And inquiry
PC1 Configuration of :

PC2 Configuration of :

Give Way PC1pingPC2

2)Cilent Visit two Http The server


3)Client Domain name resolution access Server1

As mentioned above : All the requirements of the experiment have been met , Successful experiment .
边栏推荐
猜你喜欢

今天浅讲一下转义字符【萌新版】

(the most detailed in History) codeforces round 805 (Div. 3) e Split Into Two Sets

在有序数组找具体某个数字

祝大家七夕快乐,邀你源码共读

多线程中 synchronized 锁升级的原理是什么?

NAT网络地址转换协议-拓扑实验

C language student information management system can access text files based on arrays

测试工作十年,想对还在迷茫的朋友说:一点要做好个人规划...

静态路由基本配置 实现全网可达

Tim output comparison - PWM
随机推荐
Constant knowledge explanation of C language
Hcip day 1
证券炒股开户需要现场开户吗网上开户安全吗
C language student information management system can access text files based on arrays
PPOCRLabel格式的数据集操作总结。
Interesting C language
HCIP-第四天-OSPF路由协议
oSPF基础实验配置
【C语言程序设计】分支结构
面试必问 | 一个线程从创建到消亡要经历哪些阶段?
MySQL course 1. simple command line -- simple record welcome to supplement and correct errors
Prompt to leave the page
C语言 学生信息管理系统 基于数组 可以存取到文本文件
RIP路由信息协议-拓扑实验
Detailed source code of golang bufio reader
Find a specific number in an ordered array
HCIP-第三天-广域网拓扑实验
TCP的三次握手、四次断开
聊聊自动化测试的度量指标
【降维打击,带你深度学习CPU(上)】