当前位置: 首页 > article >正文

防火墙NAT地址组NAT策略安全策略

 本文仅供学习交流,所涉及的知识技术产权归属华为技术有限公司所有!!! 

本文仅供学习交流,所涉及的知识技术产权归属华为技术有限公司所有!!!

本文仅供学习交流,所涉及的知识技术产权归属华为技术有限公司所有!!!

127.0.0.0~127.255.255.255可测试本机的网卡是否连通

0.0.0.0最小网址,任意地址 

 

ipconfid查看本地 IPv4 地址

出去时私网转公网,回来时公网转私网 

 

AR1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]INT GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24

AR2

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 24

AR3

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R3-GigabitEthernet0/0/0]q
[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.254/24     up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)      

<USG6000V1>sys
Enter system view, return user view with Ctrl+Z.
[USG6000V1]sysname FW1
[FW1]interface GigabitEthernet 1/0/0   
[FW1-GigabitEthernet1/0/0]ip address 192.168.1.254 24
[FW1-GigabitEthernet1/0/0]q
[FW1]interface GigabitEthernet 1/0/1
[FW1-GigabitEthernet1/0/1]ip address 1.1.1.1 24

AR4

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 1.1.1.2 24
[R4-GigabitEthernet0/0/0]q
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 32
[R4-LoopBack0]q
[R4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              1.1.1.2/24           up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/32           up         up(s)     
NULL0                             unassigned           up         up(s)     

配ip地址

[FW1]user-interface console 0  
[FW1-ui-console0]idle-timeout 0 0
Warning: Idle time-out is configured as 0, so session will never be disconnected
 because of timeout.
[FW1-ui-console0]q
[FW1]int g1/0/0
[FW1-GigabitEthernet1/0/0]service-manage ping permit 
[FW1-GigabitEthernet1/0/0]q
[FW1]int g1/0/1 
[FW1-GigabitEthernet1/0/1]service-manage ping permit 

加安全区域
[FW1-GigabitEthernet1/0/1]q
[FW1]firewall zone trust   
[FW1-zone-trust]add interface GigabitEthernet 1/0/0
[FW1-zone-trust]q
[FW1]firewall zone untrust 
[FW1-zone-untrust]add interface GigabitEthernet 1/0/1
[FW1-zone-untrust]q

<R1>ping 192.168.1.254
  PING 192.168.1.254: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.254: bytes=56 Sequence=1 ttl=255 time=160 ms
    Reply from 192.168.1.254: bytes=56 Sequence=2 ttl=255 time=60 ms
    Reply from 192.168.1.254: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 192.168.1.254: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 192.168.1.254: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 192.168.1.254 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/70/160 ms

<R4>ping 1.1.1.1
  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 1.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/14/30 ms

[FW1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 4        Routes : 4        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         GigabitEthernet
1/0/1
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
1/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0  
[FW1]ip route-static 4.4.4.4 32 1.1.1.2

配置静态路由
[FW1]display ip routing-table 4.4.4.4
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        4.4.4.4/32  Static  60   0          RD   1.1.1.2         GigabitEthernet
1/0/1

<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]ip route-static 201.1.1.0 29 1.1.1.1

回由

[FW1]nat address-group test
[FW1-address-group-test]mode no-pat global 
[FW1-address-group-test]section 201.1.1.1 201.1.1.6
[FW1-address-group-test]dis th
#
nat address-group test 0
 mode no-pat global
 section 0 201.1.1.1 201.1.1.6
#
return
[FW1-address-group-test]q
[FW1-policy-nat]rule name test
[FW1-policy-nat-rule-test]source-zone trust 
[FW1-policy-nat-rule-test]destination-zone untrust 
[FW1-policy-nat-rule-test]source-address 192.168.1.0 mask 255.255.255.0
[FW1-policy-nat-rule-test]dis th
#
 rule name test
  source-zone trust
  destination-zone untrust
  source-address 192.168.1.0 24
  (not configure the action)
#
return
[FW1-policy-nat-rule-test]destination-address 4.4.4.4 mask 255.255.255.255
[FW1-policy-nat-rule-test]dis th
#
 rule name test
  source-zone trust
  destination-zone untrust
  source-address 192.168.1.0 24
  destination-address 4.4.4.4 32
  (not configure the action)
#
return 
[FW1-policy-nat-rule-test]action nat address-group test

 安全策略

[FW1-policy-nat-rule-test]q
[FW1-policy-nat]q
[FW1]security-policy 
[FW1-policy-security]rule name test
[FW1-policy-security-rule-test]source-zone trust 
[FW1-policy-security-rule-test]destination-zone untrust 
[FW1-policy-security-rule-test]source-address 192.168.1.0 mask 255.255.255.0
[FW1-policy-security-rule-test]destination-address 4.4.4.4 mask 255.255.255.255 
[FW1-policy-security-rule-test]service icmp 
[FW1-policy-security-rule-test]action permit 
[FW1-policy-security-rule-test]dis th
#
 rule name test
  source-zone trust
  destination-zone untrust
  source-address 192.168.1.0 24
  destination-address 4.4.4.4 32
  service icmp
  action permit
#
return

<R1>ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.254
[R1]ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

......无语了,不知哪一步错了,[R1]ping 4.4.4.4不通

相关文章:

防火墙NAT地址组NAT策略安全策略

本文仅供学习交流&#xff0c;所涉及的知识技术产权归属华为技术有限公司所有&#xff01;&#xff01;&#xff01; 本文仅供学习交流&#xff0c;所涉及的知识技术产权归属华为技术有限公司所有&#xff01;&#xff01;&#xff01; 本文仅供学习交流&#xff0c;所涉及的…...

python开发环境管理和包管理

在 Python 开发中&#xff0c;环境管理 和 包管理 是两个非常重要的概念。它们帮助开发者&#xff1a; 这里写目录标题 一、什么是 Python 环境管理&#xff1f;二、什么是 Python 包管理&#xff1f;三、常见文件说明&#xff08;用于包管理和环境配置&#xff09;四、典型流程…...

Windows 使用 WSL 安装 Ubuntu

一&#xff0c;前言 Windows 上轻松跑 Linux 又不想用笨重的VMware 和VirtualBox &#xff0c;怎么办&#xff1f; 开源项目 Windows Subsystem for Linux (WSL)。它解决了许多开发者在 Windows 和 Linux 间切换的痛点&#xff0c;实现在 Windows 上无缝跑 Linux 工具和命令。…...

.jsx文件和.tsx文件有什么区别

.tsx 和 .jsx 是两种用于 React 开发的 JavaScript 文件扩展名&#xff0c;它们的主要区别在于对 TypeScript 的支持以及使用场景。以下是详细对比&#xff1a; 定义 .jsx&#xff1a;是 JavaScript XML 的缩写&#xff0c;用于在 JavaScript 中编写类似 XML 的 JSX 语法&…...

第九天的尝试

目录 一、每日一言 二、练习题 三、效果展示 四、下次题目 五、总结 一、每日一言 创造美好的代价是努力&#xff0c;失望以及毅力&#xff0c;首先是痛苦&#xff0c;然后才是欢乐。 时间是快的&#xff0c;看怎么利用&#xff0c;安排好一切事情&#xff0c;才能从容面对…...

每日算法 -【Swift 算法】寻找字符串中最长回文子串(三种经典解法全解析)

&#x1f9e9; 最长回文子串问题&#xff1a;三种经典解法全解析&#xff08;含代码注释&#xff09; 本文将系统讲解“最长回文子串”问题的三种常见解法&#xff1a;中心扩展法、动态规划、马拉车算法&#xff08;Manacher’s Algorithm&#xff09;&#xff0c;并进行对比与…...

《Cesium全生态解析:从入门到精通的3D地理空间开发指南》

在WebGL、GIS和三维可视化技术高速发展的今天&#xff0c;Cesium 已经从一个开源地图引擎成长为全球开发者构建数字地球的核心工具。从地球到火星&#xff0c;从网页到游戏引擎&#xff0c;Cesium以其跨平台、高精度和无限扩展性&#xff0c;重新定义了我们对空间数据的交互方式…...

pytorch LSTM 结构详解

最近项目用到了LSTM &#xff0c;但是对LSTM 的输入输出不是很理解&#xff0c;对此&#xff0c;我详细查找了lstm 的资料 import torch.nn as nnclass LSTMModel(nn.Module):def __init__(self, input_size1, hidden_size50, num_layers2):super(LSTMModel, self).__init__()…...

流程自动化引擎:重塑企业数字神经回路

在数字经济高速发展的今天&#xff0c;企业运营的核心逻辑正在经历一场静默的革命。流程自动化引擎作为这场变革的中枢神经系统&#xff0c;通过智能化的技术手段重构企业的业务逻辑与决策链路&#xff0c;将原本离散的“数字神经元”编织成高效协同的神经网络。这种技术不仅打…...

nginx web服务日志分析

特点&#xff1a; 实时分析&#xff1a;支持实时分析 Nginx 日志&#xff0c;无需预先存储大量日志数据&#xff0c;能即时反馈网站的访问情况。轻量级高效&#xff1a;资源占用少&#xff0c;运行速度快&#xff0c;适合处理高流量网站的日志分析。多种输出格式&#xff1a;除…...

VSCode+EIDE通过KeilC51编译,使VSCode+EIDE“支持”C和ASM混编

在使用Keil C51时&#xff0c;要让Keil C51支持混编则需要在混编的.c文件上右键选择Options for File *(ALTF7)&#xff0c;打开选项界面后&#xff0c;在 Properties 页 勾上 Generate Assembler SRC File 和 Assemble SRC File &#xff0c;如下图所示&#xff1a; 这样设置后…...

5.23本日总结

一、英语 复习list5list25 二、数学 写14讲部分课后题&#xff0c;学习15讲部分 三、408 写计网5.3题目&#xff0c;学习计组第一章 四、总结 二重积分的题目也涉及了一元函数积分相关知识&#xff0c;该部分遗忘较多&#xff0c;后续需要再复习。 五、明日计划 英语&…...

游戏引擎学习第298天:改进排序键 - 第1部分

关于向玩家展示多个房间层所需的两种 Z 值 我们在前一天基本完成了为渲染系统引入分层 Z 值的工作&#xff0c;但还没有完全完成所有细节。我们开始引入图形渲染中的分层概念&#xff0c;即在 Z 轴方向上拥有多个独立图层&#xff0c;每个图层内部再使用一个单独的 Z 值来实现…...

Mysql篇-优化

Mysql篇主要是纯理论的面试问题与技巧。 主要从以下进行开展&#xff1a; 索引相关问题&#xff1a; 1、Mysql如何定位慢查询&#xff1f; Mysql慢查询&#xff1a;某个业务查询数据响应时间过长或者与预期响应时间相差大。 表象&#xff1a;页面加载过慢、接口压测响应时间…...

Java 集合框架核心知识点全解析:从入门到高频面试题(含 JDK 源码剖析)

一、Java 集合框架体系架构 Java 集合框架分为两大分支&#xff1a; Collection接口&#xff1a;存储单个元素&#xff0c;包括&#xff1a; List&#xff1a;有序、可重复&#xff08;如ArrayList、LinkedList&#xff09;Set&#xff1a;无序、唯一&#xff08;如HashSet、…...

一文详解生成式 AI:李宏毅《生成式 AI 导论》学习笔记

生成式 AI 是怎么回事 人工智能&#xff08;Artificial Intelligence&#xff09; “智能”是一个广泛而复杂的概念&#xff0c;其定义和应用范围随着技术、科学和社会的发展不断演变。在当前的语境下&#xff0c;“智能”通常与人工智能&#xff08;AI&#xff09;相关联&am…...

什么是物联网 (IoT):2024 年物联网概述

物联网&#xff08;IoT&#xff09;是一个有望彻底改变我们生活、工作以及与环境互动方式的概念。如今&#xff0c;越来越多的新兴企业和老牌企业都在利用物联网的力量创造创新产品与服务。正因为这一转变&#xff0c;互联互通已成为我们生活中不可或缺的一部分&#xff0c;科技…...

8级-数组

前情回顾&#xff1a;在7级的时候&#xff0c;我们学习了如何定义、使用函数 目录 概念 什么是数组&#xff1f; 一维数组 声明 初始化 访问元素 计算数组长度 二维数组 声明 初始化 访问元素 思考 一维数组在内存中如何存储&#xff1f; 二维数组在内存中如何存储&…...

大模型 Agent 就是文字艺术吗?

最近在技术圈里有一个很有趣的争论&#xff1a;大模型 Agent 是不是就是各种 Prompt 的堆叠&#xff1f;像 Manus 这样看起来很智能的 Agent&#xff0c;本质上是不是就是用巧妙的 Prompt 约束大模型生成更好的输出&#xff1f;换句话说&#xff0c;这是不是一门文字艺术&#…...

YOLOv8检测头代码详解(示例展示数据变换过程)

本文旨在通过实例数据&#xff0c;详细解读YOLOv8检测头的网络结构及其代码实现。首先将从检测头的网络架构开始讲解&#xff0c;涵盖代码与网络结构图的对比分析。关键在于深入探讨检测头的输出结果&#xff0c;因为这些输出将直接用于损失函数的计算。由于在不同阶段&#xf…...

JUC并发编程1

什么是juc 在java的java.util.concurrent包下的工具。 锁 传统的synchronize public class SealTicket {int total 50;public synchronized void seal() {if (total > 0) {System.out.println(Thread.currentThread().getName() "卖出第" (total--) "张…...

消息队列RabbitMQ与AMQP协议详解

消息队列RabbitMQ与AMQP协议详解 什么是RabbitMQ RabbitMQ是一个开源的消息队列中间件&#xff0c;基于AMQP&#xff08;Advanced Message Queuing Protocol&#xff09;协议实现。它作为一个消息代理&#xff08;Message Broker&#xff09;&#xff0c;可以接收、存储和转发…...

Day 29 训练

Day 29 训练 Day 29&#xff1a;Python 类装饰器的奥秘与实践一、类装饰器&#xff1a;函数装饰器的升级版二、类装饰器 VS 函数装饰器&#xff1a;核心区别三、实战&#xff1a;为类添加日志功能四、类方法定义的两种风格1. 类内部定义方法&#xff08;常规方式&#xff09;2.…...

STM32开发环境配置——VSCode+PlatformIO + CubeMX + FreeRTOS的集成环境配置

前言 为什么配置这样的一个环境呢&#xff1f;鄙人受够了Keil5那个简陋的工作环境了&#xff0c;实在是用不下去&#xff0c;调试上很容易跟CubeMX的代码产生不协调导致调试——发布代码不一致造成的一系列问题。CubeIDE虽说不错&#xff0c;但是它的代码辅助功能和构建系统实在…...

Profibus转Profinet网关赋能鼓式硫化机:智能化生产升级的关键突破

在现代工业自动化领域&#xff0c;通讯协议转换器发挥着至关重要的角色。它们能够实现不同网络间的无缝对接和数据传输&#xff0c;确保了生产线上的设备可以顺畅地交流信息。今天&#xff0c;我们就来深入讨论开疆智能profibus转profinet网关KJ-PBM-PN以及其在鼓式硫化机中的应…...

redis 缓存穿透,缓存雪崩,缓存击穿

之前也不知道是哪个老六总结出来得缓存穿透&#xff0c;缓存击穿 。 穿透&#xff0c;击穿 中文上容易搞混&#xff0c;所以贴出英文 缓存穿透: Cache Penetration “Penetration” 有穿透、渗透之意, eg: the penetration of hackers into the system (黑客对系统的侵入) 缓…...

JAVA8怎么使用9的List.of

在 Java 8 中&#xff0c;List.of 方法并不可用&#xff0c;因为这是从 Java 9 开始引入的用于创建不可变列表的便捷方法。要在 Java 8 中达到类似的效果&#xff0c;您需要使用其他方式来创建列表。常规的方法是先创建集合对象然后再添加元素 List<String> list new A…...

告别手动测试:AUTOSAR网络管理自动化测试实战

文章目录 一、自动化测试系统架构硬件组成软件架构 二、测试覆盖的关键场景状态机测试时间参数测试容错性测试 三、测试case举例四、小结 一、自动化测试系统架构 AUTOSAR网络管理自动化测试由硬件设备和软件工具共同完成。 硬件组成 程控电源&#xff08;DUT供电&#xff0…...

BUCK电路利用状态空间平均法和开关周期平均法推导

以BUCK电路为例的两种方法推导 BUCK电路简介 BUCK电路是一种降压型DC-DC转换器,其拓扑结构如下: 输入电压 V in V_{\text{in}} Vin​,输出电压 V out = D V in V_{\text{out}} = D V_{\text{in}} Vout​=DVin​(稳态时, D D D为占空比)。关键元件:开关管 S S S、续流…...

MongoDB 用户与权限管理完全指南

在当今数据驱动的时代&#xff0c;数据库安全已成为企业IT架构中最关键的环节之一。作为最受欢迎的NoSQL数据库之一&#xff0c;MongoDB提供了完善的用户认证和权限管理机制&#xff0c;但许多开发者和数据库管理员对这些功能的理解和应用仍停留在表面层次。本文将全面剖析Mong…...