防火墙配置(命令)

部署运行你感兴趣的模型镜像

拓扑图:
在这里插入图片描述
目的:PC1和PC2相互ping通。

配置命令:
FW1:
//添加端口IP
[SRG-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[SRG-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[SRG]inter g0/0/2
[SRG-GigabitEthernet0/0/2]ip add 10.0.0.1 24
//做静态路由使得连通
[SRG]ip route-static 0.0.0.0 0 10.0.0.2
//进入区域
[SRG]firewall zone trust
//将接口划入相应区域
[SRG-zone-trust]add interface GigabitEthernet 0/0/1
[SRG]firewall zone untrust
[SRG-zone-untrust]add interface GigabitEthernet 0/0/2
//策略
[SRG]firewall packet-filter default permit interzone trust untrust direction outbound
Warning:Setting the default packet filtering to permit poses security risks. You are advised to configure the security policy based on the actual data flows. Are you sure you want to continue?[Y/N]y
[SRG]firewall packet-filter default permit interzone untrust trust direction inbound
Warning:Setting the default packet filtering to permit poses security risks. You are advised to configure the security policy based on the actual data flows. Are you sure you want to continue?[Y/N]y

FW2:
[SRG]inter g0/0/1
[SRG-GigabitEthernet0/0/1]ip add 192.168.2.1 24
[SRG-GigabitEthernet0/0/1]
[SRG]inter g0/0/2
[SRG-GigabitEthernet0/0/2]ip add 10.0.0.2 24
[SRG]ip route-static 0.0.0.0 0 10.0.0.1
[SRG]firewall zone untrust
[SRG-zone-untrust]add interface GigabitEthernet 0/0/2
[SRG]firewall zone trust
[SRG-zone-trust]add interface GigabitEthernet 0/0/1
[SRG]firewall packet-filter default permit interzone trust untrust direction inbound
Warning:Setting the default packet filtering to permit poses security risks. You are advised to configure the security policy based on the actual data flows. Are you sure you want to continue?[Y/N]y
[SRG]firewall packet-filter default permit interzone untrust trust direction outbound
Warning:Setting the default packet filtering to permit poses security risks. You are advised to configure the security policy based on the actual data flows. Are you sure you want to continue?[Y/N]y

结果:
在这里插入图片描述
在这里插入图片描述

您可能感兴趣的与本文相关的镜像

TensorFlow-v2.9

TensorFlow-v2.9

TensorFlow

TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型

### 防火墙配置命令示例 以下是一些常见的防火墙配置命令示例,涵盖了不同厂商的设备和功能需求: #### 1. Cisco PIX 防火墙配置 以下是 Cisco PIX 防火墙中用于配置 ISAKMP 策略、加密映射以及隧道组的相关命令: ```bash pixfirewall(config)# isakmp policy 10 pixfirewall(config-isakmp-policy)# group 1 pixfirewall(config-isakmp-policy)# lifetime 86400 pixfirewall(config-isakmp-policy)# encryption des pixfirewall(config-isakmp-policy)# authentication pre-share pixfirewall(config-isakmp-policy)# hash sha pixfirewall(config-isakmp-policy)# exit pixfirewall(config)# isakmp enable outside pixfirewall(config)# isakmp key cllsse123 address 192.168.3.3 pixfirewall(config)# crypto map fw1 10 ipsec-isakmp pixfirewall(config)# crypto map fw1 10 match address 101 pixfirewall(config)# crypto map fw1 10 set peer 192.168.3.3 pixfirewall(config)# crypto ipsec transform-set fw5 esp-3des pixfirewall(config)# crypto map fw1 10 set transform-set fw5 pixfirewall(config)# crypto map fw1 interface outside ``` 这些命令用于设置 IPSec 加密策略并将其绑定到外部接口[^1]。 #### 2. NG 防火墙访问控制策略 在 NG 防火墙上添加一条访问控制策略,禁止特定源地址和目的地址之间的 HTTP 流量: ```bash # firewall policy add action deny src '182.87.97.111 182.87.97.112' dst '182.248.21.170 182.248.21.171' service 'tcp_8080 HTTP' ``` 如果仅有一个服务,则无需加引号[^2]。 #### 3. 华为防火墙 AAA 配置 华为防火墙配置本地用户认证的命令如下: ```bash aaa local-user admin password cipher admin@123 local-user admin service-type telnet ``` 上述命令设置了本地用户 `admin` 的密码,并允许其通过 Telnet 登录设备[^3]。 #### 4. 创建服务和 IP 地址对象 以下是在防火墙上创建服务和 IP 地址对象的示例: - **单个端口服务**: ```bash service tcp-901 tcp dst-port 901 ``` - **端口范围服务**: ```bash service tcp-10000-65535 tcp dst-port 10000 65535 ``` - **服务组(类似思科 ASA 的 object-group)**: ```bash servgroup Management service SSH service xdmcp_UDP_177 service HTTPS service tcp-901 ``` - **单个 IP 地址对象**: ```bash address RDM-WaiGua-System-10.248.68.114 ip 10.248.68.114/32 ``` - **IP 地址范围对象**: ```bash address 10.248.68.5-40 range 10.248.68.5 10.248.68.40 ``` 这些命令用于定义服务和地址对象,便于后续策略配置[^4]。 --- ###
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值