nat report finished
BIN
9_NAT/10网络工程-防火墙NAT策略.pptx
Normal file
BIN
9_NAT/NAT配置.jpg
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
9_NAT/dmz接口配置.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
9_NAT/download10.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
9_NAT/download11.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
9_NAT/download12.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
9_NAT/download13.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
9_NAT/download14.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
9_NAT/download15.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
9_NAT/download16.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
153
9_NAT/labtemplate.typ
Normal file
@ -0,0 +1,153 @@
|
||||
#let times = "Times LT Pro"
|
||||
#let times = "Times New Roman"
|
||||
#let song = (times, "Noto Serif CJK SC")
|
||||
#let hei = (times, "Noto Sans CJK SC")
|
||||
#let kai = (times, "Noto Serif CJK SC")
|
||||
#let xbsong = (times, "Noto Serif CJK SC")
|
||||
#let fsong = (times, "Noto Serif CJK SC")
|
||||
#let code = (times, "JetBrains Mono")
|
||||
#let nudtlabpaper(title: "",
|
||||
author: "",
|
||||
id: "",
|
||||
training_type:"",
|
||||
grade: "",
|
||||
major: "",
|
||||
department: "",
|
||||
advisor: "",
|
||||
jobtitle: "",
|
||||
lab: "",
|
||||
date: "",
|
||||
header_str: "",
|
||||
body) = {
|
||||
// Set the document's basic properties.
|
||||
set document(author: author, title: title)
|
||||
set page(
|
||||
|
||||
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
|
||||
)
|
||||
|
||||
// Title row.
|
||||
v(158pt)
|
||||
align(center)[
|
||||
#block(text(weight: 700, size: 30pt, font: hei, tracking: 15pt, "网络工程"))
|
||||
]
|
||||
align(center)[
|
||||
#block(text(weight: 700, size: 30pt, font: song, tracking: 15pt, "本科实验报告"))
|
||||
]
|
||||
|
||||
v(103pt)
|
||||
pad(
|
||||
left: 1em,
|
||||
right: 1em,
|
||||
grid(
|
||||
columns: (80pt, 1fr),
|
||||
rows: (17pt, auto),
|
||||
text(weight: 700, size: 16pt, font: song, "实验名称:"),
|
||||
align(center, text(weight: "regular", size: 16pt, font: song, title)),
|
||||
text(""),
|
||||
line(length: 100%)
|
||||
)
|
||||
// #block(text(weight: 700, 1.75em, title))
|
||||
// underline(text(weight: 700, size: 16pt, font: song, title))
|
||||
)
|
||||
|
||||
// Author information.
|
||||
|
||||
v(82.5pt)
|
||||
|
||||
grid(
|
||||
columns: (0.25fr, 0.25fr, 0.25fr, 0.25fr),
|
||||
rows: (15pt, 8pt, 15pt, 8pt, 15pt, 8pt, 15pt, 8pt, 15pt),
|
||||
text(size: 14pt, font: song, tracking: 10pt, "学员姓名"),
|
||||
align(center, text(size: 14pt, font: song, author)),
|
||||
text(size: 14pt, font: song, tracking: 54pt, "学号"),
|
||||
align(center, text(size: 14pt, font: times, id)),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(size: 14pt, font: song, tracking: 9pt, "培养类型"),
|
||||
align(center, text(size: 14pt, font: song, training_type)),
|
||||
text(size: 14pt, font: song, tracking: 54pt, "年级"),
|
||||
align(center, text(size: 14pt, font: times, grade)),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(size: 14pt, font: song, tracking: 54pt, "专业"),
|
||||
align(center, text(size: 14pt, font: song, major)),
|
||||
text(size: 14pt, font: song, tracking: 9pt, "所属学院"),
|
||||
align(center, text(size: 14pt, font: song, department)),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(size: 14pt, font: song, tracking: 9pt, "指导教员"),
|
||||
align(center, text(size: 14pt, font: song, advisor)),
|
||||
text(size: 14pt, font: song, tracking: 54pt, "职称"),
|
||||
align(center, text(size: 14pt, font: song, jobtitle)),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(size: 14pt, font: song, tracking: 20pt, "实验室"),
|
||||
align(center, text(size: 14pt, font: song, lab)),
|
||||
text(size: 14pt, font: song, tracking: 9pt, "实验时间"),
|
||||
align(center, text(size: 14pt, font: song, date)),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
text(""),
|
||||
line(length: 100%),
|
||||
)
|
||||
|
||||
v(50.5pt)
|
||||
align(center, text(font: hei, size: 15pt, "国防科技大学教育训练部制"))
|
||||
|
||||
pagebreak()
|
||||
|
||||
set page(
|
||||
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
|
||||
numbering: "i",
|
||||
number-align: center,
|
||||
)
|
||||
|
||||
v(14pt)
|
||||
align(center)[
|
||||
#block(text(font: hei, size: 14pt, "《本科实验报告》填写说明"))
|
||||
]
|
||||
|
||||
v(14pt)
|
||||
text("")
|
||||
par(first-line-indent: 2em, text(font: song, size: 12pt, "实验报告内容编排应符合以下要求:"))
|
||||
|
||||
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "(1)采用A4(21cm×29.7cm)白色复印纸,单面黑字。上下左右各侧的页边距均为3cm;缺省文档网格:字号为小4号,中文为宋体,英文和阿拉伯数字为Times New Roman,每页30行,每行36字;页脚距边界为2.5cm,页码置于页脚、居中,采用小5号阿拉伯数字从1开始连续编排,封面不编页码。"))
|
||||
|
||||
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "(2)报告正文最多可设四级标题,字体均为黑体,第一级标题字号为4号,其余各级标题为小4号;标题序号第一级用“一、”、“二、”……,第二级用“(一)”、“(二)” ……,第三级用“1.”、“2.” ……,第四级用“(1)”、“(2)” ……,分别按序连续编排。"))
|
||||
|
||||
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "(3)正文插图、表格中的文字字号均为5号。"))
|
||||
|
||||
pagebreak()
|
||||
|
||||
set page(
|
||||
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
|
||||
numbering: "1",
|
||||
number-align: center,
|
||||
)
|
||||
|
||||
set heading(numbering: "1.1")
|
||||
// set text(font: hei, lang: "zh")
|
||||
|
||||
show heading: it => box(width: 100%)[
|
||||
#v(0.50em)
|
||||
#set text(font: hei)
|
||||
#counter(heading).display()
|
||||
// #h(0.5em)
|
||||
#it.body
|
||||
]
|
||||
// Main body.
|
||||
set par(justify: true)
|
||||
|
||||
body
|
||||
}
|
||||
|
||||
#let para(t) = par(first-line-indent: 2em, text(font: song, size: 10.5pt, t))
|
||||
BIN
9_NAT/nat-trust.jpg
Normal file
|
After Width: | Height: | Size: 64 KiB |
24661
9_NAT/nat.pdf
Normal file
320
9_NAT/nat.typ
Normal file
@ -0,0 +1,320 @@
|
||||
#import "labtemplate.typ": *
|
||||
#show: nudtlabpaper.with(title: "NAT配置",
|
||||
author: "程景愉",
|
||||
id: "202302723005",
|
||||
training_type: "无军籍",
|
||||
grade: "2023",
|
||||
major: "网络工程",
|
||||
department: "计算机学院",
|
||||
advisor: "张军",
|
||||
jobtitle: "工程师",
|
||||
lab: "306-707",
|
||||
date: "2025.09.30",
|
||||
header_str: "《网络工程》实验报告",
|
||||
)
|
||||
#set page(header: [
|
||||
#set par(spacing: 6pt)
|
||||
#align(center)[#text(size: 11pt)[《网络工程》实验报告]]
|
||||
#v(-0.3em)
|
||||
#line(length: 100%, stroke: (thickness: 1pt))
|
||||
],)
|
||||
|
||||
#show heading: it => box(width: 100%)[
|
||||
#v(0.50em)
|
||||
#set text(font: hei)
|
||||
#it.body
|
||||
]
|
||||
|
||||
#outline(title: "目录",depth: 3, indent: 1em)
|
||||
#pagebreak()
|
||||
#outline(
|
||||
title: [图目录],
|
||||
target: figure.where(kind: image),
|
||||
)
|
||||
|
||||
#show heading: it => box(width: 100%)[
|
||||
#v(0.50em)
|
||||
#set text(font: hei)
|
||||
#counter(heading).display()
|
||||
// #h(0.5em)
|
||||
#it.body
|
||||
]
|
||||
#set enum(indent: 0.5em,body-indent: 0.5em,)
|
||||
#pagebreak()
|
||||
= 实验目的
|
||||
- 了解NAT(网络地址转换)的基本概念及其在网络中的作用;
|
||||
- 掌握NAT的三种主要类型:静态NAT、动态NAT和PAT(端口地址转换);
|
||||
- 理解NAT的工作原理,特别是NAPT和NAT Server的工作机制;
|
||||
- 掌握在华为防火墙上配置NAT的步骤和方法,能够通过实际操作验证NAT的功能;
|
||||
- 通过实验,加深对NAT在网络安全中的应用的理解。
|
||||
= 实验原理
|
||||
== NAT的概念
|
||||
=== NAT概述
|
||||
#para[
|
||||
网络地址转换(Network Address Translation,NAT)是一种将私有网络地址转换为公共网络地址的技术。NAT技术是为了解决IPv4地址资源短缺问题而提出的,它通过将内部网络的私有地址转换为公共地址,实现内部网络与外部网络的通信。NAT技术是一种在网络层对IP地址进行转换的技术,主要用于解决IPv4地址资源短缺问题。
|
||||
]
|
||||
#para[
|
||||
随着网络应用的增多,IPv4地址枯竭的问题越来越严重。尽管IPv6可以从根本上解决IPv4地址空间不足问题,但目前众多网络设备和网络应用大多是基于IPv4的,因此在IPv6广泛应用之前,使用一些过渡技术(如CIDR、私网地址等)是解决这个问题的主要方式,NAT就是这众多过渡技术中的一种。
|
||||
]
|
||||
#para[
|
||||
当私网用户访问公网的报文到达网关设备后,如果网关设备上部署了NAT功能,设备会将收到的IP数据报文头中的IP地址转换为另一个IP地址,端口号转换为另一个端口号之后转发给公网。在这个过程中,设备可以用同一个公网地址来转换多个私网用户发过来的报文,并通过端口号来区分不同的私网用户,从而达到地址复用的目的。
|
||||
]
|
||||
#para[
|
||||
早期的NAT是指Basic NAT,Basic NAT在技术上实现比较简单,只支持地址转换,不支持端口转换。因此,Basic NAT只能解决私网主机访问公网问题,无法解决IPv4地址短缺问题。后期的NAT主要是指网络地址端口转换NAPT(Network Address Port Translation),NAPT既支持地址转换也支持端口转换,允许多台私网主机共享一个公网IP地址访问公网,因此NAPT才可以真正改善IP地址短缺问题。
|
||||
]
|
||||
=== NAT主要功能
|
||||
#para[
|
||||
NAT主要有如下几个功能:
|
||||
]
|
||||
|
||||
1. IP地址转换:将内部网络的私有地址转换为公共地址,实现内部网络与外部网络的通信。
|
||||
2. 端口转换:将内部网络的私有端口转换为公共端口,实现多个内部主机共享一个公共IP地址。
|
||||
3. 地址复用:多个内部主机共享一个公共IP地址,提高地址利用率。
|
||||
4. 安全防护:NAT可以隐藏内部网络的真实IP地址,提高网络安全性。
|
||||
5. 减少IPv4地址的消耗:NAT技术可以减少IPv4地址的消耗,延长IPv4地址的使用寿命。
|
||||
#pagebreak()
|
||||
== NAT的类型
|
||||
#para[
|
||||
NAT技术主要有三种类型:静态NAT、动态NAT和PAT(端口地址转换)。静态NAT是一种将内部网络的私有地址转换为公共地址的技术,将内部网络的私有地址与公共地址一一对应,实现内部网络与外部网络的通信。动态NAT是一种将内部网络的私有地址转换为公共地址的技术,将内部网络的私有地址与公共地址动态对应,实现内部网络与外部网络的通信。PAT是一种将内部网络的私有地址转换为公共地址的技术,将内部网络的私有地址与公共地址动态对应,同时还将端口号进行转换,实现内部网络与外部网络的通信。
|
||||
]
|
||||
|
||||
=== SNAT(源NAT)
|
||||
#para[
|
||||
源NAT在NAT转换时,仅对报文中的源地址进行转换,主要应用于私网用户访问公网的场景。当私网用户主机访问Internet时,私网用户主机发送的报文到达NAT设备后,设备通过源NAT技术将报文中的私网IPv4地址转换成公网IPv4地址,从而使私网用户可以正常访问Internet。
|
||||
]
|
||||
#para[
|
||||
根据转换时是否同时转换源端口号,源NAT可以细分为如下几种类型,详见@figure10 。
|
||||
]
|
||||
#figure(
|
||||
image("download10.png",fit:"stretch",width: 100%),
|
||||
caption: [源NAT分类]
|
||||
)<figure10>
|
||||
|
||||
=== DNAT(目的NAT)
|
||||
#para[
|
||||
目的NAT在NAT转换时,仅对报文中的目的地址和目的端口号进行转换,主要应用于公网用户访问私网服务的场景。当公网用户主机发送的报文到达NAT设备后,设备通过目的NAT技术将报文中的公网IPv4地址转换成私网IPv4地址,从而使公网用户可以使用公网地址访问私网服务。
|
||||
]
|
||||
#para[
|
||||
根据转换前后的地址是否存在一种固定的映射关系,目的NAT可以细分为如下几种类型,详见@figure11 。
|
||||
]
|
||||
|
||||
#figure(
|
||||
image("download11.png",fit:"stretch",width: 100%),
|
||||
caption: [目的NAT分类]
|
||||
)<figure11>
|
||||
|
||||
#pagebreak()
|
||||
=== 双向NAT
|
||||
#para[
|
||||
双向NAT指的是在转换过程中同时转换报文的源信息和目的信息。双向NAT不是一个单独的功能,而是源NAT和目的NAT的组合。双向NAT是针对同一条流,在其经过设备时同时转换报文的源地址和目的地址。双向NAT主要应用在同时有外网用户访问内部服务器和私网用户访问内部服务器的场景。
|
||||
]
|
||||
|
||||
=== STUN中定义的NAT类型
|
||||
#para[
|
||||
在 STUN 标准中,根据私网IP地址和端口到NAT出口的公网IP地址和端口的映射方式,把NAT分为如下四种类型,详见@figure12 。
|
||||
]
|
||||
|
||||
|
||||
#figure(
|
||||
image("download12.png",fit:"stretch",width: 100%),
|
||||
caption: [STUN中定义的NAT类型]
|
||||
)<figure12>
|
||||
|
||||
- Full Cone NAT(完全锥型NAT)
|
||||
- Restricted Cone NAT(限制锥型NAT)
|
||||
- Port Restricted Cone NAT(端口限制锥型NAT)
|
||||
- Symmetric NAT(对称NAT)
|
||||
|
||||
== NAT的工作原理
|
||||
#para[
|
||||
根据前面的分类,我分别从源NAT和目的NAT中各选一种NAT为代表,介绍其工作原理。其他类型的NAT虽然在转换时,转换的内容有细微差别,但是工作原理都相似,不再重复介绍。此外,双向NAT是源NAT和目的NAT的组合,双向NAT的工作原理也不再重复介绍。
|
||||
]
|
||||
|
||||
=== NAPT工作原理
|
||||
#para[
|
||||
NAPT在进行地址转换的同时还进行端口转换,可以实现多个私网用户共同使用一个公网IP地址上网。NAPT根据端口来区分不同用户,真正做到了地址复用。
|
||||
]
|
||||
|
||||
#figure(
|
||||
image("download13.png",fit:"stretch",width: 80%),
|
||||
caption: [NAPT工作原理示意图]
|
||||
)<figure13>
|
||||
#para[
|
||||
当Host访问Web Server时,设备的处理过程如下:
|
||||
]
|
||||
|
||||
1. 设备收到Host发送的报文后查找NAT策略,发现需要对报文进行地址转换。
|
||||
2. 设备根据源IP Hash算法从NAT地址池中选择一个公网IP地址,替换报文的源IP地址,同时使用新的端口号替换报文的源端口号,并建立会话表,然后将报文发送至Internet。
|
||||
3. 设备收到Web Server响应Host的报文后,通过查找会话表匹配到步骤2中建立的表项,将报文的目的地址替换为Host的IP地址,将报文的目的端口号替换为原始的端口号,然后将报文发送至Intranet。
|
||||
|
||||
=== NAT Server工作原理
|
||||
#para[
|
||||
使用NAT Server时,需要先在设备上配置公网地址和私网地址的固定映射关系。配置完成后,设备将会生成Server-Map表项,存放公网地址和私网地址的映射关系。该表项将一直存在除非NAT Server的配置被删除。
|
||||
]
|
||||
|
||||
#figure(
|
||||
image("download14.png",fit:"stretch",width: 65%),
|
||||
caption: [NAT Server工作原理示意图]
|
||||
)<figure14>
|
||||
#para[
|
||||
内部Server的私网IPv4地址为192.168.1.2/24,对外的公网IPv4地址为1.1.1.10,端口号都为80,它们之间的映射关系在设备上已提前配置好。当Host访问Server时,设备的处理过程如下:
|
||||
]
|
||||
|
||||
1. 设备收到Internet上用户访问1.1.1.10的报文的首包后,查找并匹配到Server-Map表项,将报文的目的IP地址转换为192.168.1.2。
|
||||
2. 设备建立会话表,然后将报文发送至Intranet。
|
||||
3. 设备收到Server响应Host的报文后,通过查找会话表匹配到步骤2中建立的表项,将报文的源地址替换为1.1.1.10,然后将报文发送至Internet。
|
||||
4. 后续Host继续发送给Server的报文,设备都会直接根据会话表项的记录对其进行转换,而不会再去查找Server-map表项。
|
||||
|
||||
== NAT的应用
|
||||
#para[
|
||||
上文已介绍过不同的NAT类型适用于不同的应用场景。下面介绍几种典型的NAT应用。
|
||||
]
|
||||
|
||||
=== 私网用户通过NAPT访问Internet
|
||||
#para[
|
||||
在许多小区、学校和企业的私网规划中,由于公网地址资源有限,通常给私网用户分配私网IPv4地址。此时,可以配置源NAT来实现私网用户访问Internet。用户可以根据自己拥有的公网IPv4地址的个数,选择使用NAPT或者Easy IP。
|
||||
]
|
||||
#para[
|
||||
当用户拥有的公网IP地址个数较多时,配置了NAT设备出接口的IP地址和其他应用之后,还有可用的空闲公网IP地址时,可以选择NAPT。NAPT使用地址池内的IPv4地址作为私网主机转换后的公网IPv4地址。如@figure15 所示,在设备上配置NAPT,实现私网主机访问Internet功能。
|
||||
]
|
||||
|
||||
#figure(
|
||||
image("download15.png",fit:"stretch",width: 65%),
|
||||
caption: [私网用户通过NAPT访问Internet]
|
||||
)<figure15>
|
||||
|
||||
=== 私网用户通过Easy IP访问Internet
|
||||
#para[
|
||||
当用户拥有的公网IPv4地址个数较少时,配置了NAT设备出接口的IPv4地址和其他应用之后,没有可用的空闲公网IPv4地址时,可以选择Easy IP。Easy IP使用出接口的IPv4地址作为私网主机转换后的公网IPv4地址。如@figure16 所示,在设备上配置Easy IP,实现私网主机访问Internet功能。
|
||||
]
|
||||
|
||||
=== 公网用户通过NAT Server访问私网服务器
|
||||
#para[
|
||||
在某些场合,私网中有一些服务器需要向公网用户提供服务,比如私网中部署的一些Web服务器、FTP服务器等,NAT支持这样的应用,此时可以配置NAT Server来实现公网用户访问私网服务器。如下图所示,在设备上配置NAT Server,固定“公网IP地址+端口号”与“私网IP地址+端口号”间的映射关系,实现公网主机通过该映射关系访问私网服务器功能。
|
||||
]
|
||||
#figure(
|
||||
image("download16.png",fit:"stretch",width: 65%),
|
||||
caption: [公网用户通过NAT Server访问私网服务器]
|
||||
)<figure16>
|
||||
|
||||
|
||||
= 实验环境
|
||||
== 实验背景
|
||||
#para[
|
||||
本实验在华为USG6303E-AC防火墙上进行,通过配置NAT,实现私网用户访问公网的功能。实验中将介绍NAT的配置步骤和注意事项,并通过实际操作验证NAT的工作原理和效果。
|
||||
]
|
||||
== 实验设备
|
||||
#align(center)[#table(
|
||||
columns: (auto, auto,auto),
|
||||
rows:(2em,2em,3em),
|
||||
inset: 10pt,
|
||||
align: horizon+center,
|
||||
table.header(
|
||||
[*设备名称*], [*设备型号*], [*设备数量*]
|
||||
),
|
||||
"防火墙", "华为USG6303E-AC", "1",
|
||||
"PC", "联想启天M410
|
||||
Windows 10", "3",
|
||||
)]
|
||||
#para[
|
||||
另有网线若干。
|
||||
]
|
||||
= 实验步骤及结果
|
||||
== 实验拓扑
|
||||
#para[
|
||||
按实验背景,绘制拓扑图如下:
|
||||
]
|
||||
#figure(image("实验拓扑.png",format: "png",fit:"stretch",width: 100%),caption: "实验拓扑图")
|
||||
== 按照拓扑图接线
|
||||
#para[
|
||||
按照拓扑图接线。
|
||||
]
|
||||
#figure(image("机柜正面连线.png",format: "jpg",fit:"stretch",width: 60%),caption: "机柜接线图")
|
||||
== 配置基本网络
|
||||
=== 配置PC
|
||||
- 配置PC1的IP地址为`192.168.1.2/24`,网关为`192.168.1.1`;
|
||||
- 配置PC2的IP地址为`10.13.1.2/24`,网关为`10.13.1.1`;
|
||||
#para[
|
||||
步骤简单,展示图略。这样配置之后,PC1、PC2分别属于`trust`、`untrust`区域;管理PC通过MGMT网口管理防火墙。
|
||||
]
|
||||
== 配置防火墙
|
||||
=== 配置接口
|
||||
#para[
|
||||
配置`trust`区域接口`G0/0/1`的IP地址为`192.168.1.1/24`,区域为`trust`;
|
||||
]
|
||||
#figure(image("trust接口配置.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "trust接口配置")
|
||||
#para[
|
||||
配置`untrust`区域接口`G0/0/2`的IP地址为`10.13.1.2/24`,区域为`untrust`。
|
||||
]
|
||||
#figure(image("untrust接口配置.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "untrust接口配置")
|
||||
=== 配置安全策略
|
||||
#para[
|
||||
如@figure17 所示配置安全策略:允许`trust`区域的用户访问`untrust`区域的网络(图中dmz策略非本实验重点)。
|
||||
]
|
||||
#figure(image("安全策略配置.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "安全策略配置")<figure17>
|
||||
=== 配置NAT
|
||||
#para[
|
||||
进入“策略”→“NAT策略”界面,配置NAT策略,如@figure18 所示。
|
||||
]
|
||||
#para[
|
||||
配置源NAT,将`trust`区域的用户的私网IP地址转换为`untrust`区域的公网IP地址:
|
||||
]
|
||||
#figure(image("NAT配置.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "trust访问外网源地址转换")<figure18>
|
||||
== 验证NAT功能
|
||||
#para[
|
||||
配置完成后,PC1访问外网,查看NAT策略表,如@figure19 所示:
|
||||
]
|
||||
#figure(image("ping之前.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "NAT转换表(ping之前)")<figure19>
|
||||
#para[
|
||||
注意到图中的命中次数为3。
|
||||
]
|
||||
#para[
|
||||
下面在PC1上ping外网(PC2),如@figure20 所示,可以ping通。
|
||||
]
|
||||
#figure(image("nat-trust.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "PC1 ping PC2")<figure20>
|
||||
#para[
|
||||
此时再次查看NAT策略表,如@figure21 所示:
|
||||
]
|
||||
#figure(image("ping之后.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "NAT转换表(ping之后)")<figure21>
|
||||
#para[
|
||||
注意到图中的命中次数为4,命中转换策略,说明NAT转换成功。
|
||||
]
|
||||
= 实验总结
|
||||
#para[
|
||||
本次实验通过在华为USG6303E-AC防火墙上配置NAT,成功实现了私网用户访问公网的功能。通过实验,我深入了解了NAT的基本概念、类型及其工作原理。实验过程中配置了防火墙的接口、安全策略和NAT策略,并通过验证NAT功能,确认了NAT转换的成功。
|
||||
]
|
||||
#para[
|
||||
实验的主要收获如下:
|
||||
]
|
||||
1. NAT的基本概念:NAT是一种将私有网络地址转换为公共网络地址的技术,主要用于解决IPv4地址资源短缺问题,同时也能提高网络的安全性。
|
||||
|
||||
2. NAT的类型:我掌握了静态NAT、动态NAT和PAT的区别及其适用场景,特别是PAT(端口地址转换)在地址复用中的重要作用。
|
||||
|
||||
3. NAT的工作原理:通过实验,我深入理解了NAPT和NAT Server的工作机制,特别是NAPT如何通过端口号区分不同用户,实现地址复用。
|
||||
|
||||
4. NAT的配置:我学会了在华为防火墙上配置NAT的步骤,包括接口配置、安全策略配置和NAT策略配置,并通过实际操作验证了NAT的功能。
|
||||
|
||||
5. NAT的应用:通过实验,我认识到NAT在网络安全和地址复用中的广泛应用,特别是在私网用户访问公网和公网用户访问私网服务器等场景中的重要作用。
|
||||
#para[
|
||||
实验过程中,我也遇到了一些挑战,例如在配置NAT策略时,需要确保安全策略的正确配置,否则会导致NAT转换失败。通过实验,我不仅加深了对NAT技术的理解,还提高了在实际网络环境中配置和调试NAT的能力。
|
||||
]
|
||||
#para[
|
||||
总的来说,本次实验达到了预期的目标,帮助我更好地掌握了NAT技术及其在网络中的应用。未来,我可以进一步探索NAT在复杂网络环境中的高级应用,如双向NAT和NAT与VPN的结合等。
|
||||
]
|
||||
|
||||
#show heading: it => box(width: 100%)[
|
||||
#v(0.50em)
|
||||
#set text(font: hei)
|
||||
// #counter(heading).display()
|
||||
// #h(0.5em)
|
||||
#it.body
|
||||
]
|
||||
#pagebreak()
|
||||
#bibliography("ref.yml",full: true,title: "参考文献",style:"gb-7714-2015-numeric")
|
||||
|
||||
|
||||
/*
|
||||
根据这个网站的格式示范https://github.com/typst/hayagriva/blob/main/docs/file-format.md
|
||||
为这个网页生成.yml文件
|
||||
https://blog.csdn.net/jxjdhdnd/article/details/138009187
|
||||
*/
|
||||
BIN
9_NAT/ping之前.jpg
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
9_NAT/ping之后.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
18
9_NAT/ref.yml
Normal file
@ -0,0 +1,18 @@
|
||||
huawei_nat:
|
||||
type: Web
|
||||
title: 什么是NAT?NAT的类型有哪些?- 华为
|
||||
author: 华为技术支持
|
||||
date: 2024-12-29
|
||||
url:
|
||||
value: https://info.support.huawei.com/info-finder/encyclopedia/zh/NAT.html
|
||||
summary: NAT解决了IPv4地址枯竭的问题,通过地址转换实现私网用户访问公网和公网用户访问私网服务。
|
||||
genre: 技术文档
|
||||
publisher:
|
||||
name: 华为
|
||||
location: 中国
|
||||
language: zh-Hans
|
||||
parent:
|
||||
type: Article
|
||||
title: NAT技术详解
|
||||
abstract: 本文详细介绍了NAT技术,包括其工作原理、类型以及应用场景。
|
||||
publisher: 华为技术支持
|
||||
BIN
9_NAT/trust接口配置.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
9_NAT/untrust接口配置.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
9_NAT/安全策略配置.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
9_NAT/实验拓扑.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
9_NAT/机柜正面连线.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 150 KiB |