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

news2025/5/24 22:53:59

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

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

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

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不通

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2384929.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Windows 使用 WSL 安装 Ubuntu

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

第九天的尝试

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

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

在数字经济高速发展的今天&#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; 这样设置后…

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

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

Mysql篇-优化

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

一文详解生成式 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--) "张…

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

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

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

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

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

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

基于ITcpServer/IHttpServer框架的HTTP服务器

https://www.cnblogs.com/MuZhangyong/p/16839231.html 在基于ITcpServer/IHttpServer框架的HTTP服务器实现中,OnBody方法主要用于接收HTTP请求体数据,而触发HTTP响应通常是在OnMessageComplete方法中完成。以下是完整的响应触发机制说明: sequenceDiagramClient->>…

FPGA高效验证工具Solidify 8.0:全面重构图形用户界面

近日&#xff0c;FPGA高效验证工具Solidify发布了8.0版本。该版本对图形用户界面&#xff08;GUI&#xff09;进行了全面重构&#xff0c;历时两年&#xff0c;经过了大幅的架构改进&#xff0c;旨在为用户提供更安全、更稳定的使用环境。 Solidify的用户对隐私有严格要求&…

SIL2/PLd 认证 Inxpect毫米波安全雷达:3D 扫描 + 微小运动检测守护工业安全

Inxpect 成立于意大利&#xff0c;专注工业安全技术。自成立起&#xff0c;便致力于借助先进雷达技术提升工业自动化安全标准&#xff0c;解决传统安全设备在复杂环境中的局限&#xff0c;推出获 SIL2/PLd 和 UL 认证的安全雷达产品。 Inxpect 的雷达传感器技术优势明显。相较于…

2025电工杯数学建模A题思路数模AI提示词工程

我发布的智能体链接&#xff1a;数模AI扣子是新一代 AI 大模型智能体开发平台。整合了插件、长短期记忆、工作流、卡片等丰富能力&#xff0c;扣子能帮你低门槛、快速搭建个性化或具备商业价值的智能体&#xff0c;并发布到豆包、飞书等各个平台。https://www.coze.cn/search/n…