华为eNSP模拟器综合实验之- 华为USG6000V防火墙配置防御DoS攻击实战案例解析

DoS攻击防御解析

在ENSP中使用USG6000V配置DoS攻击防御,是理解网络安全主动防御的关键实践。

一、DoS攻击问题源头解析

1.1 DoS攻击基本概念

**DoS(Denial of Service)**攻击是指攻击者通过大量无效请求或恶意流量,耗尽目标系统资源,使其无法正常提供服务的攻击方式(如带宽、连接数、CPU/内存),使其无法为合法用户提供正常服务。主要类型包括:

  • SYN Flood攻击:利用TCP三次握手漏洞,发送大量SYN请求但不完成握手
  • UDP Flood攻击:发送大量UDP数据包,消耗目标系统资源
  • ICMP Flood攻击:通过大量ICMP请求(Ping)淹没目标
  • HTTP Flood攻击:发送大量HTTP请求,消耗Web服务器资源

1.2 攻击源头分析

  • 僵尸网络:大量被控制的肉鸡同时发起攻击
  • 单点攻击:单个恶意主机发起高强度攻击
  • 反射放大攻击:利用协议特性放大攻击流量
  • 应用层攻击:针对特定应用协议的漏洞
以SYN Flood为例详解源头

攻击者向目标服务器发送大量伪造源IP的TCP SYN报文。服务器会回复SYN-ACK并等待第三次握手(ACK),从而在半开连接队列中创建大量条目。由于源IP是伪造的,ACK永远不会到来,这些半连接会持续占用资源直至超时,最终填满队列,导致服务器无法接受新的合法连接。

二、防范DoS攻击的意义

2.1 业务连续性保障

  • 确保关键业务系统7*24小时可用
  • 避免因攻击导致的业务中断损失

2.2 资源保护

  • 防止服务器资源被恶意消耗
  • 保护网络带宽不被无效流量占用

2.3 声誉维护

  • 维护企业在线服务的可靠性形象
  • 避免因服务中断导致的客户流失

2.4 合规要求

  • 满足网络安全等级保护要求
  • 符合行业监管标准

三、USG6000V防火墙DoS防御实战案例

3.1 网络拓扑设计

复制代码
┌─────────────┐      ┌──────────────┐      ┌─────────────┐
│   Internet  │──────│   USG6000V   │──────│   Internal  │
│   (Untrust) │      │   Firewall   │      │   (Trust)   │
└─────────────┘      └──────────────┘      └─────────────┘
                           │
                           │
                    ┌──────┴──────┐
                    │   DMZ Zone  │
                    │   Servers   │
                    └─────────────┘

3.2 基础配置准备

复制代码
# 1. 登录防火墙并修改默认密码
<USG6000V> system-view
[USG6000V] sysname FW1
[FW1] aaa
[FW1-aaa] local-user admin password cipher Huawei@123
[FW1-aaa] local-user admin service-type web terminal
[FW1-aaa] local-user admin privilege level 15
[FW1-aaa] quit

# 2. 配置接口IP地址和安全区域
[FW1] interface GigabitEthernet 1/0/0
[FW1-GigabitEthernet1/0/0] ip address 202.100.1.1 255.255.255.0
[FW1-GigabitEthernet1/0/0] quit

[FW1] interface GigabitEthernet 1/0/1
[FW1-GigabitEthernet1/0/1] ip address 192.168.1.1 255.255.255.0
[FW1-GigabitEthernet1/0/1] quit

[FW1] firewall zone untrust
[FW1-zone-untrust] add interface GigabitEthernet 1/0/0
[FW1-zone-untrust] quit

[FW1] firewall zone trust
[FW1-zone-trust] add interface GigabitEthernet 1/0/1
[FW1-zone-trust] quit

# 3. 配置静态路由
[FW1] ip route-static 0.0.0.0 0.0.0.0 202.100.1.254

四、DoS攻击防御详细配置

4.1 单包攻击防范配置

复制代码
# 进入系统视图
[FW1] system-view

# 1. 启用Teardrop攻击防范
[FW1] firewall defend teardrop enable
# 说明:Teardrop攻击利用IP分片重叠漏洞

# 2. 启用Ping of Death攻击防范
[FW1] firewall defend ping-of-death enable
# 说明:防止超大ICMP包攻击

# 3. 启用Smurf攻击防范
[FW1] firewall defend smurf enable
# 说明:防止利用广播地址的ICMP攻击

# 4. 启用Land攻击防范
[FW1] firewall defend land enable
# 说明:防止源地址和目的地址相同的攻击包

# 5. 启用WinNuke攻击防范
[FW1] firewall defend winnuke enable
# 说明:防止针对Windows系统的OOB数据攻击

# 6. 启用时间戳攻击防范
[FW1] firewall defend time-stamp enable

# 7. 启用Tracert攻击防范
[FW1] firewall defend tracert enable

4.2 DDoS攻击防范配置

4.2.1 SYN Flood攻击防御
复制代码
# 1. 配置全局SYN Flood防范参数
[FW1] anti-ddos syn-flood defend alert-rate 1000
[FW1] anti-ddos syn-flood defend max-rate 2000
[FW1] anti-ddos syn-flood source-detect enable
[FW1] anti-ddos syn-flood source-detect mode basic

# 2. 配置接口级SYN Flood防范
[FW1] interface GigabitEthernet 1/0/0
[FW1-GigabitEthernet1/0/0] anti-ddos syn-flood defend alert-rate 500
[FW1-GigabitEthernet1/0/0] anti-ddos syn-flood defend max-rate 1000
[FW1-GigabitEthernet1/0/0] anti-ddos syn-flood source-detect enable
[FW1-GigabitEthernet1/0/0] quit

# 3. 配置SYN Flood源认证
[FW1] anti-ddos syn-flood source-detect
[FW1-anti-ddos-syn-flood-source-detect] mode basic
[FW1-anti-ddos-syn-flood-source-detect] quit
4.2.2 UDP Flood攻击防御
复制代码
# 1. 配置全局UDP Flood防范参数
[FW1] anti-ddos udp-flood defend alert-rate 1000
[FW1] anti-ddos udp-flood defend max-rate 2000
[FW1] anti-ddos udp-flood base-session enable
[FW1] anti-ddos udp-flood base-session rate 100

# 2. 配置接口级UDP Flood防范
[FW1] interface GigabitEthernet 1/0/0
[FW1-GigabitEthernet1/0/0] anti-ddos udp-flood defend alert-rate 500
[FW1-GigabitEthernet1/0/0] anti-ddos udp-flood defend max-rate 1000
[FW1-GigabitEthernet1/0/0] anti-ddos udp-flood base-session enable
[FW1-GigabitEthernet1/0/0] anti-ddos udp-flood base-session rate 50
[FW1-GigabitEthernet1/0/0] quit
4.2.3 ICMP Flood攻击防御
复制代码
# 1. 配置全局ICMP Flood防范
[FW1] anti-ddos icmp-flood defend alert-rate 100
[FW1] anti-ddos icmp-flood defend max-rate 200

# 2. 配置接口级ICMP Flood防范
[FW1] interface GigabitEthernet 1/0/0
[FW1-GigabitEthernet1/0/0] anti-ddos icmp-flood defend alert-rate 50
[FW1-GigabitEthernet1/0/0] anti-ddos icmp-flood defend max-rate 100
[FW1-GigabitEthernet1/0/0] quit
4.2.4 HTTP Flood攻击防御
复制代码
# 1. 配置全局HTTP Flood防范
[FW1] anti-ddos http-flood defend alert-rate 100
[FW1] anti-ddos http-flood defend max-rate 200
[FW1] anti-ddos http-flood source-detect enable

# 2. 配置接口级HTTP Flood防范
[FW1] interface GigabitEthernet 1/0/1
[FW1-GigabitEthernet1/0/1] anti-ddos http-flood defend alert-rate 50
[FW1-GigabitEthernet1/0/1] anti-ddos http-flood defend max-rate 100
[FW1-GigabitEthernet1/0/1] anti-ddos http-flood source-detect enable
[FW1-GigabitEthernet1/0/1] quit

4.3 流量型攻击动态限流配置

复制代码
# 1. 配置基于会话的动态限流
[FW1] anti-ddos auto-defend base-session enable
[FW1] anti-ddos auto-defend base-session rate 1000
[FW1] anti-ddos auto-defend base-session alert-rate 500

# 2. 配置无会话流量的动态限流
[FW1] anti-ddos auto-defend none-session enable
[FW1] anti-ddos auto-defend none-session rate 500
[FW1] anti-ddos auto-defend none-session alert-rate 200

# 3. 配置动态限流类型
[FW1] anti-ddos auto-defend none-session type udp-flood icmp-flood

4.4 阈值学习配置(智能防御)

复制代码
# 1. 启动阈值学习
[FW1] anti-ddos baseline-learn start

# 2. 配置学习参数
[FW1] anti-ddos baseline-learn learn-duration 3600
[FW1] anti-ddos baseline-learn learn-interval 300

# 3. 应用学习结果
[FW1] anti-ddos baseline-learn apply

4.5 IP信誉功能配置

复制代码
# 1. 启用IP信誉功能
[FW1] anti-ddos ip-reputation enable

# 2. 配置IP信誉例外
[FW1] anti-ddos ip-reputation exception 192.168.1.100

4.6 配置思路与建议

  1. 阈值调优 :初始阈值 (threshold) 应基于业务正常流量基准值设定。在ENSP中可尝试设置较低值(如100)来快速观察效果,生产环境需谨慎评估。

  2. 结合其他防御

    • TCP代理(TCP Proxy) :防火墙代替服务器与客户端完成三次握手,有效防御SYN Flood。可在firewall defend syn-flood视图下配置。

    • 黑名单:对于明确持续攻击的源IP,可配置黑名单直接丢弃其所有报文。

      [USG6000V] firewall blacklist enable
      [USG6000V] firewall blacklist item 1 source-ip 202.100.1.10

  3. 全局启用:除了针对区域,还可以全局启用基础攻击防范。

    复制代码
    [USG6000V] firewall defend attack enable

五、安全策略配置

复制代码
# 1. 配置从Trust到Untrust的安全策略
[FW1] security-policy
[FW1-policy-security] rule name trust_to_untrust
[FW1-policy-security-rule-trust_to_untrust] source-zone trust
[FW1-policy-security-rule-trust_to_untrust] destination-zone untrust
[FW1-policy-security-rule-trust_to_untrust] source-address 192.168.1.0 24
[FW1-policy-security-rule-trust_to_untrust] action permit
[FW1-policy-security-rule-trust_to_untrust] quit

# 2. 配置从Untrust到DMZ的安全策略(仅允许特定服务)
[FW1] firewall zone dmz
[FW1-zone-dmz] add interface GigabitEthernet 1/0/2
[FW1-zone-dmz] quit

[FW1-policy-security] rule name untrust_to_dmz_web
[FW1-policy-security-rule-untrust_to_dmz_web] source-zone untrust
[FW1-policy-security-rule-untrust_to_dmz_web] destination-zone dmz
[FW1-policy-security-rule-untrust_to_dmz_web] destination-address 10.0.0.100 32
[FW1-policy-security-rule-untrust_to_dmz_web] service http https
[FW1-policy-security-rule-untrust_to_dmz_web] action permit
[FW1-policy-security-rule-untrust_to_dmz_web] quit

[FW1-policy-security] quit

六、日志和监控配置

复制代码
# 1. 配置攻击日志
[FW1] firewall defend log-time enable
[FW1] firewall ddos log-server-ip 192.168.1.100

# 2. 配置日志级别
[FW1] info-center loghost 192.168.1.100
[FW1] info-center source default channel loghost log level warning

# 3. 启用攻击统计
[FW1] anti-ddos statistic enable

七、验证和测试命令

复制代码
# 1. 查看单包攻击防范状态
[FW1] display firewall defend configuration

# 2. 查看DDoS攻击防范信息
[FW1] display anti-ddos defend information

# 3. 查看SYN Flood攻击统计
[FW1] display anti-ddos syn-flood statistics

# 4. 查看UDP Flood攻击统计
[FW1] display anti-ddos udp-flood statistics

# 5. 查看ICMP Flood攻击统计
[FW1] display anti-ddos icmp-flood statistics

# 6. 查看HTTP Flood攻击统计
[FW1] display anti-ddos http-flood statistics

# 7. 查看动态限流状态
[FW1] display anti-ddos auto-defend statistics

# 8. 查看阈值学习结果
[FW1] display anti-ddos baseline-learn result

# 9. 查看IP信誉状态
[FW1] display anti-ddos ip-reputation statistics

八、实践建议

8.1 配置优化建议

  1. 根据实际流量调整阈值:避免误报和漏报
  2. 分层防御策略:结合网络层和应用层防护
  3. 定期更新特征库:保持对新型攻击的识别能力
  4. 建立应急响应机制:攻击发生时快速响应

8.2 性能优化建议

  1. 合理分配资源:避免防护功能影响正常业务
  2. 启用硬件加速:利用USG6000V的硬件处理能力
  3. 定期清理会话表:防止资源耗尽

8.3 监控和维护建议

  1. 建立监控告警:实时发现异常流量
  2. 定期分析日志:识别潜在威胁
  3. 制定应急预案:明确攻击处理流程
  4. 定期演练测试:验证防护效果

九、总结

华为USG6000V防火墙提供了全面的DoS/DDoS攻击防御能力,通过命令行配置可以实现精细化的防护策略。关键要点包括:

  1. 多层防护:结合单包攻击防范和DDoS攻击防范
  2. 智能学习:利用阈值学习功能自适应调整防护策略
  3. 精细控制:支持全局和接口级的差异化配置
  4. 实时监控:完善的日志和统计功能

通过合理的配置和持续的优化,可以有效提升网络的安全防护能力,保障业务的稳定运行。

相关推荐
凤年徐2 小时前
Linux权限详解:从入门到掌握
linux·运维·服务器
努力打怪升级2 小时前
Apache HTTP Server 2.4 Windows 版完整配置与运维手册
运维·http·apache
zhgjx-dengkewen2 小时前
eNSP实验:配置Easy IP方式的源NAT
网络·华为
zzzyyy5382 小时前
进程优先级
linux·运维·服务器
腾科IT教育2 小时前
华为云计算运维工程师怎么考?2026年报考攻略
运维·华为云·华为认证·hcip考试·华为hcip考试
m0_685535082 小时前
华为光学工程师面试题全解析(2026最新版)
华为·光学·光学设计·光学工程·镜头设计
西西弟2 小时前
网络通信基础之UDP基本通信
网络·网络协议·tcp/ip·udp
网络安全许木2 小时前
自学渗透测试第八天(网络安全法、伦理规范与工具链联动)
windows·web安全·网络安全·渗透测试·kali linux
pencek2 小时前
HakcMyVM-Animetronic
网络安全