当前位置:网站首页>NAT实验演示(Huawei交换机设备配置)
NAT实验演示(Huawei交换机设备配置)
2022-07-28 18:40:00 【51CTO】
一、NAT介绍
NAT(Network Address Translation)网络地址转换,可以将IP数据报文头中的IP地址转换为另一个IP地址,并通过转换端口号达到地址重用的目的,NAT由于实现简单,有效地缓解了IPv4公有地址短缺的问题,目前应用广泛。
二、实验目的
通过NAT,实现PC1和PC2可以访问到互联网上的Server1;
三、实验拓扑

四、实验配置
(1)PC1,PC2配置上IP地址,子网掩码和网关。


(2)R1配置
<Huawei>system-view
#进入视图模式
[Huawei]sysname R1
#修改路由器名称
[R1]un in en
#关闭日志提示
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]q
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/1]q
[R1]nat address-group 1 12.1.1.3 12.1.1.5
#创建一个地址池
[R1]acl 2000
#创建标准ACL
[R1-acl-basic-2000]rule 10 permit source 192.168.1.0 0.0.0.255
#允许内网地址段
[R1-acl-basic-2000]q
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]nat outbound 2000 address-group 1
#外网口调用ACL和地址池
[R1-GigabitEthernet0/0/1]q
[R1]ip route-static 0.0.0.0 0 12.1.1.2
#R1上配置缺省路由 下一条为ISP的G0/0/0口
(3)ISP配置
<Huawei>system-view
[Huawei]sysname ISP
[ISP]un in en
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[ISP-GigabitEthernet0/0/1]int g0/0/1
[ISP-GigabitEthernet0/0/1]ip add 23.1.1.1 24
[ISP-GigabitEthernet0/0/1]q
[ISP]ospf 1
[ISP-ospf-1]area 0
[ISP-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[ISP-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
(4)Server1配置
<Huawei>system-view
[Huawei]sys Server1
[Server1]interface g0/0/0
[Server1-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[Server1-GigabitEthernet0/0/0]q
[Server1]un in en
[Server1]ospf 1
[Server1-ospf-1]area 0
[Server1-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
(5)用PC1和PC2 ping Server1 测试是否连通


PC1和PC2 ping Server1可以ping通,配置成功。
边栏推荐
- Residual network RESNET source code analysis - pytoch version
- 弹出模态框
- Install keras, tensorflow, and add the virtual environment to the Jupiter notebook
- js win7透明桌面切换背景开始菜单js特效
- 华为云数字资产链,“链”接数字经济无限精彩
- Raspberry pie CM4 -- using metartc3.0 to integrate ffmpeg to realize webrtc push-pull streaming
- CNN convolution neural network learning process (weight update)
- About IP address
- Unity performance optimization
- Three steps to teach you unity serial communication
猜你喜欢
随机推荐
Raspberry pie 4B deploy yolov5 Lite using ncnn
Three steps to teach you unity serial communication
Vivado designs PC and ram
太空射击第14课: 玩家生命
Leetcode-297 serialization and deserialization of binary tree
Networkx common operations summary (for personal use)
如何平衡SQL中的安全与性能?
Unity performance optimization scheme arrangement
Use of DDR3 (axi4) in Xilinx vivado (3) module packaging
Configure Windows Server + install MySQL database on the server + Remote Access database
js飞入js特效弹窗登录框
Soft raid
Simple example of C language 1
Regular symbol description
太空射击第10课: Score (繪畫和文字)
Explain RESNET residual network in detail
Solve the problem that jupyter cannot import new packages
#yyds干货盘点# 面试必刷TOP101:链表中的节点每k个一组翻转
字符设备驱动结构
平均海拔4000米!我们在世界屋脊建了一朵云









