当前位置:首页>Linux>Linux nftables 详解:新一代防火墙入门与实战

Linux nftables 详解:新一代防火墙入门与实战

  • 2026-02-08 08:18:39
Linux nftables 详解:新一代防火墙入门与实战

一、引言:为什么需要 nftables?

如果你是 Linux 系统管理员,你一定用过 iptables。这个诞生于 1998 年的防火墙工具,陪伴我们走过了二十多年的风雨。然而,随着网络环境日益复杂,iptables 的局限性也越来越明显:

规则复杂难维护——IPv4、IPv6、ARP 分别有独立的工具(iptables、ip6tables、arptables),语法不统一,配置容易出错。性能瓶颈——每条规则都要遍历链表查找,规则多了之后效率急剧下降。竞态条件——规则更新时可能产生短暂的安全缺口。

2014 年,Linux 内核 3.13 版本带来了 nftables,这是一个全新的网络过滤框架,旨在彻底解决这些问题。现在,nftables 已经成为 RHEL 8、Debian 10+、Ubuntu 20.04+ 的默认防火墙方案。

┌─────────────────────────────────────────────────────────────────────────┐                    iptables vs nftables 对比                            ├─────────────────────────────────────────────────────────────────────────┤                                                                           ┌─────────────────────────────────────────────────────────────────┐                           传统 iptables 架构                                                                                                          ┌─────────────┐  ┌─────────────┐  ┌─────────────┐                       iptables       ip6tables      arptables                         (IPv4)         (IPv6)         (ARP)                           └──────┬──────┘  └──────┬──────┘  └──────┬──────┘                                                                                                └────────────────┴────────────────┘                                                                                                                    ┌─────┴─────┐                                                           Netfilter    内核模块各自独立实现                                       Hooks                                                              └───────────┘                                      └─────────────────────────────────────────────────────────────────┘                                                                              ┌─────────────────────────────────────────────────────────────────┐                           现代 nftables 架构                                                                                                          ┌─────────────────────────────────────────────────────┐                                  nft 命令行工具                                            (统一管理 IPv4/IPv6/ARP/Bridge)                              └────────────────────────┬────────────────────────────┘                                                                                     ┌────────────────────────┴────────────────────────────┐                             nftables 虚拟机引擎                                           (统一的字节码解释器,生成高效的过滤逻辑)                             └────────────────────────┬────────────────────────────┘                                                                                                        ┌─────┴─────┐                                                           Netfilter    统一的钩子接口                                             Hooks                                                               └───────────┘                                    └─────────────────────────────────────────────────────────────────┘                                                                            └─────────────────────────────────────────────────────────────────────────┘

图示说明:iptables 为每种协议维护独立的内核模块,而 nftables 使用统一的虚拟机引擎

1.1 nftables 的核心优势

特性

iptables

nftables

架构

多个独立工具(iptables/ip6tables/arptables)

统一的 nft 命令

规则更新

非原子性,可能有安全窗口

原子性替换,无窗口期

查找效率

链表查找,O(n)

哈希集合,O(1)

语法

每个工具语法略有差异

统一声明式语法

灵活性

固定匹配条件

表达式系统,高度灵活

内存占用

规则重复加载

共享基础设施,内存高效


二、核心概念:庖丁解牛 nftables

要理解 nftables,我们需要先理解它的核心架构。与 iptables 的"表-链-规则"三层结构类似,nftables 也是类似的层次,但更加灵活和强大。

2.1 基础结构:表、链、规则

nftables 的基本结构与 iptables 类似,但更加简洁统一:

概念

说明

类比

Table(表)

规则的容器

文件柜

Chain(链)

数据包的检查点

文件柜中的抽屉

Rule(规则)

具体的过滤动作

抽屉中的文件夹

┌─────────────────────────────────────────────────────────────────┐│                         nftables 结构                            ││                                                                 ││   ┌─────────────────────────────────────────────────────────┐   ││   │                      Table (filter)                     │   ││   │                                                         │   ││   │   ┌─────────────┐         ┌─────────────┐               │   ││   │   │ Chain: input│         │ Chain: forward              │   ││   │   │ priority 0  │         │ priority 0  │               │   ││   │   │ type filter │         │ type filter │               │   ││   │   │ hook input  │         │ hook forward│               │   ││   │   └──────┬──────┘         └──────┬──────┘               │   ││   │          │                       │                      │   ││   │          ▼                       ▼                      │   ││   │   ┌─────────────────────────────────────────────┐       │   ││   │   │  Rule 1: ip saddr 192.168.1.0/24 accept     │       │   ││   │   │  Rule 2: tcp dport ssh accept               │       │   ││   │   │  Rule 3: tcp dport http accept              │       │   ││   │   │  Rule 4: ct state established accept        │       │   ││   │   │  Rule 5: drop                               │       │   ││   │   └─────────────────────────────────────────────┘       │   ││   └─────────────────────────────────────────────────────────┘   ││                                                                 │└─────────────────────────────────────────────────────────────────┘

图示说明:表包含链,链包含规则,规则是最终的执行单元

2.2 链的类型

nftables 中的链分为两种类型,理解它们的区别非常重要:

类型

说明

用途

Base Chain(基础链)

挂载到 Netfilter Hook 点的链

直接处理进入/转发/离开的数据包

Regular Chain(普通链)

不挂载 Hook 点,仅用于跳转

模块化规则,便于复用

# 定义 Base Chain(挂载到 hook 点)chain input {    type filter hook input priority 0;    # ... 规则}# 定义 Regular Chain(用于跳转)chain my_services {    tcp dport {2280443} accept}

2.3 Hook 点与数据包流向

nftables 相比 iptables 多了 Ingress Hook,这是位于网络驱动的最底层:

                    ┌─────────────────────────────────────────────────┐                    │              数据包进入网卡驱动                    │                    └─────────────────────────────────────────────────┘                                      │                                      ▼                    ┌─────────────────────────────────────────────────┐                    │              Ingress Hook (第 5 优先权)          │                    │            (内核 4.2+ 支持,最先处理)            │                    └─────────────────────────────────────────────────┘                                      │                                      ▼                    ┌─────────────────────────────────────────────────┐                    │              Prerouting Hook                    │                    │           (路由决策之前的最后机会)                │                    └─────────────────────────────────────────────────┘                                      │                                      ▼                         ┌────────────┴────────────┐                         ▼                         ▼              ┌─────────────────┐        ┌─────────────────┐              │  路由决策        │        │  路由决策        │              │ (本机/转发)      │        │ (本机/转发)      │              └────────┬────────┘        └────────┬────────┘                       │                          │              ┌────────┴────────┐                 │              ▼                 ▼                 │      ┌──────────────┐  ┌──────────────┐          │      │   Input      │  │   Forward    │          │      │   Chain      │  │   Chain      │          │      └──────┬───────┘  └──────┬───────┘          │             │                 │                  │             ▼                 ▼                  │      ┌──────────────┐  ┌──────────────┐          │      │  本机进程     │  │   Output     │          │      │  处理         │  │   Chain      │          │      └──────────────┘  └──────┬───────┘          │                               │                  │                               ▼                  │                    ┌─────────────────────────┐   │                    │     Postrouting Hook     │◄─┘                    │     (离开前的最后处理)   │                    └─────────────────────────┘                                      │                                      ▼                    ┌─────────────────────────────────────────────────┐                    │              数据包离开网卡驱动                    │                    └─────────────────────────────────────────────────┘

图示说明:nftables 支持 6 个 Hook 点,比 iptables 多了 Ingress

2.4 Sets(集合):高效查找的秘诀

nftables 最强大的特性之一是 Sets(集合)。在 iptables 中,如果你想匹配多个 IP,需要写多条规则;在 nftables 中,可以用一个 Set 存储所有 IP,实现 O(1) 时间复杂度的查找。

# 定义一个 Set 存储黑名单 IPset blacklist {    type ipv4_addr    flags timeout    elements = {        192.168.1.100,        10.0.0.50,        203.0.113.0/24    }}# 在规则中使用 Setchain input {    ip saddr @blacklist drop}

💡性能对比:假设有 10000 个黑名单 IP,使用 iptables 的链表查找需要遍历 10000 次,而使用 nftables 的哈希集合只需 1 次查找。

2.5 Maps(映射):动态决策

Maps 类似编程语言中的字典,可以实现根据一个值查找另一个值:

# 端口映射:根据访问的端口转发到不同的后端map port_redirect {    type inet_service : ipv4_addr    elements = {        80 : 192.168.1.100,        443 : 192.168.1.100,        8080 : 192.168.1.200    }}chain prerouting {    type nat hook prerouting priority 0;    dnat to tcp dport map @port_redirect}

三、语法入门:从零开始

掌握了核心概念后,我们来学习 nftables 的基本语法。nftables 的语法采用声明式风格,比 iptables 更加清晰和易于理解。

3.1 安装与基本命令

# Debian/Ubuntusudo apt install nftables# RHELsudo dnf install nftables# 启动服务sudo systemctl enable --now nftables# 查看当前配置sudo nft list ruleset# 清空所有规则sudo nft flush ruleset

3.2 创建表和链

将下面的配置保存在文件中,使用 nft -f example.nft应用到服务器上

# 创建 inet 表(同时支持 IPv4 和 IPv6)table inet filter {    # 创建 input 链(基础链,挂载到 hook)    chain input {        type filter hook input priority 0;        # 规则写在这里    }    # 创建 forward 链    chain forward {        type filter hook forward priority 0;    }    # 创建 output 链    chain output {        type filter hook output priority 0;    }}

或使用命令行

# 创建 inet 地址族下的 filter 表nft add table inet filter# 在 filter 表中创建 input 链(并指定类型为 filter,钩子为 input,优先级可选)nft add chain inet filter input { type filter hook input priority 0 \; }

3.3 添加规则

# 允许回环接口nft add rule inet filter input iif lo accept# 允许已建立的连接nft add rule inet filter input ct state established,related accept# 允许 SSHnft add rule inet filter input tcp dport 22 accept# 允许 HTTP/HTTPSnft add rule inet filter input tcp dport {80443} accept# 默认拒绝nft add rule inet filter input drop

3.4 使用脚本文件

为了便于管理和版本控制,建议使用脚本文件:

# /etc/nftables.conf#!/usr/sbin/nft -fflush rulesettable inet filter {    chain input {        type filter hook input priority 0;        # 基础规则        iif lo accept        ct state established,related accept        # 服务规则        tcp dport 22 accept        tcp dport {80443accept        # 默认策略        drop    }    chain output {        type filter hook output priority 0;        ct state established,related accept    }}
# 加载配置sudo nft -f /etc/nftables.conf# 查看配置sudo nft list ruleset

四、进阶特性:让防火墙更强大

nftables 相比 iptables 最大的优势在于其灵活的表达式和丰富的特性。下面介绍几个最实用的进阶特性。

4.1 Sets 实战:动态黑名单

Sets 是 nftables 最强大的特性之一,支持动态更新:

table inet filter {    # 基础链定义    chain input {        type filter hook input priority 0;        # 允许已建立连接        ct state established,related accept        # 允许回环        iif lo accept        # 动态黑名单(timeout 表示自动过期)        set blackhole {            type ipv4_addr            flags timeout        }        ip saddr @blackhole drop        # 允许的服务        tcp dport 22 accept        tcp dport {80443} accept        # 默认拒绝        drop    }}
# 添加 IP 到黑名单(立即生效)sudo nft add element inet filter blackhole { 203.0.113.50 }# 添加 IP 段到黑名单sudo nft add element inet filter blackhole { 192.168.100.0/24 }# 从黑名单移除sudo nft delete element inet filter blackhole { 203.0.113.50 }# 查看黑名单内容sudo nft list set inet filter blackhole

4.2 Maps 实战:智能端口转发

使用 Maps 可以实现智能的端口转发:

table nat {    chain prerouting {        type nat hook prerouting priority 0;        # 端口映射:根据 dport 查找 target_addr        map port_map {            type inet_service : ipv4_addr            elements = {                80 : 192.168.1.100,                443 : 192.168.1.100,                8080 : 192.168.1.200,                3306 : 192.168.1.201            }        }        # DNAT 转发        dnat to tcp dport map @port_map    }    chain postrouting {        type nat hook postrouting priority 0;        # MASQUERADE(动态 SNAT)        oif eth0 masquerade    }}

4.3 流量限制:防止 DDoS

table inet filter {    chain input {        type filter hook input priority 0;        # 基础规则        iif lo accept        ct state established,related accept        # SSH 暴力破解防护:每个 IP 每分钟最多 5 次新连接        tcp dport 22 meter ssh_limit {            type ip_addr            size 65535        } {            ip saddr limit rate 5/minute accept        }        tcp dport 22 drop        # HTTP DDoS 防护:限制连接速率        tcp dport 80 meter http_flood {            type ip_addr            size 65535        } {            ip saddr limit rate 100/second accept        }        tcp dport 80 drop        # 默认拒绝        drop    }}

4.4 复合条件匹配

table inet filter {    chain input {        type filter hook input priority 0;        # 组合条件:特定 IP 访问特定端口        ip saddr 192.168.1.100 tcp dport 22 accept        # 范围匹配:内网 IP 访问多个端口        ip saddr 192.168.0.0/16 tcp dport {22804438080} accept        # MAC 地址匹配        ether saddr 00:11:22:33:44:55 accept        # 连接速率限制        tcp dport 80 ip saddr & 255.255.255.0 { 192.168.1.0 } limit rate 10/second accept    }}

五、从 iptables 迁移

5.1 迁移工具

nftables 提供了 iptables-translate 工具,可以将 iptables 规则转换为 nftables 格式:

# 安装迁移工具sudo apt install iptables-nftables-compat  # Debian/Ubuntusudo dnf install iptables-nft              # RHEL# 转换单条规则sudo iptables-translate -A INPUT -p tcp --dport 22 -j ACCEPT# 输出: nft add rule ip filter input tcp dport 22 accept# 转换整个规则链sudo iptables-save | sudo iptables-restore-translate -f -# 查看所有转换sudo iptables-translate -L -n

5.2 混合使用的风险

虽然 nftables 可以与 iptables 混合使用,但不推荐:

# 风险:# 1. 规则执行顺序不确定# 2. 可能产生冲突# 3. 性能下降(需要维护两套规则)# 推荐做法:# 1. 备份现有 iptables 规则sudo iptables-save > /root/iptables.backup# 2. 停止 iptables 服务sudo systemctl stop iptablessudo systemctl mask iptables# 3. 使用 nftablessudo nft -f /etc/nftables.conf

5.3 持久化配置

# 保存当前配置到文件sudo nft list ruleset > /etc/nftables.conf# 设置开机自动加载# 编辑 /etc/systemd/system/nftables.service[Unit]Description=nftablesAfter=network-pre.targetWants=network-pre.target[Service]Type=oneshotExecStart=/etc/nftables.confExecReload=/etc/nftables.confExecStop=/etc/nftables.confRemainAfterExit=yes[Install]WantedBy=multi-user.target# 启用服务sudo systemctl enable --now nftables.service

六、常见问题与最佳实践

6.1 常见问题

问题一:规则不生效

# 1. 检查语法错误sudo nft -f -n /etc/nftables.conf  # 试运行,不实际加载# 2. 查看错误信息sudo nft -a list ruleset# 3. 检查链是否正确挂载sudo nft list ruleset# 确认 chain 显示 "hook input priority 0;"

问题二:连接被意外断开

# 1. 先测试规则,不实际应用sudo nft -f -n /etc/nftables.conf# 2. 使用 timeout 延迟生效sudo nft -f /etc/nftables.conf &sleep 60 && sudo nft flush ruleset  # 60 秒后自动清空# 3. 确保有"允许已建立连接"的规则ct state established,related accept

问题三:性能问题

# 1. 使用 Sets 替代多个 OR 条件# 错误: tcp dport {22, 80, 443, 8080, 9000, 9001, 9002}# 正确: 定义 set 存储端口# 2. 优化规则顺序# 高频规则放在前面tcp dport 80 accept  # 常用,放在前面tcp dport 3306 accept  # 不常用,放在后面# 3. 查看规则统计sudo nft list ruleset -a

6.2 最佳实践

实践一:使用原子更新

# 不要一条一条添加规则sudo nft add rule ...sudo nft add rule ...sudo nft add rule ...# 而是使用脚本一次性加载sudo nft -f /etc/nftables.conf# 整个配置原子性替换,无窗口期

实践二:模块化配置

# /etc/nftables.conf#!/usr/sbin/nft -fflush rulesetinclude "/etc/nftables/tables.nft"include "/etc/nftables/chains.nft"include "/etc/nftables/rulesets.nft"

实践三:日志记录

chain input {    type filter hook input priority 0;    # 记录被拒绝的连接    drop log prefix "nft-drop: " level info flags all    # 可选:记录到达的包(调试用)    # log prefix "nft-input: " level debug flags all}

实践四:定期备份

# 创建备份脚本#!/bin/bashBACKUP_FILE="/root/nftables-backup-$(date +%Y%m%d).conf"nft list ruleset > $BACKUP_FILEecho "备份完成: $BACKUP_FILE"# 添加到 crontab# 0 3 * * 0 /root/backup-nftables.sh

实践五:监控和告警

# 监控规则变化#!/bin/bashHASH=$(nft list ruleset | md5sum | cut -d' ' -f1)while truedo    sleep 60    NEW_HASH=$(nft list ruleset | md5sum | cut -d' ' -f1)    if [ "$HASH" != "$NEW_HASH" ]; then        echo "nftables 规则已变更!" | mail -s "告警: 防火墙规则变更" admin@example.com        HASH=$NEW_HASH    fidone

七、总结

nftables 是 Linux 防火墙的未来。相比 iptables,它具有以下优势:

核心优势

  • 统一架构:IPv4、IPv6、ARP、Bridge 一套语法
  • 高性能:基于虚拟机机制,使用字节码解释器
  • 原子更新:规则替换无窗口期,无竞态条件
  • 灵活表达式:支持 Sets、Maps、复合条件
  • 简洁语法:声明式风格,易于理解和维护

核心概念回顾

概念

说明

Table

规则的容器

Chain

数据包检查点(基础链或普通链)

Rule

具体过滤动作

Set

IP/端口集合,O(1) 查找

Map

键值映射,动态决策

学习路径

  1. 入门:理解基本结构,掌握表、链、规则的创建
  2. 进阶:学习 Sets 和 Maps,实现动态规则
  3. 实战:在生产环境中应用,积累经验
  4. 精通:深入虚拟机机制,优化性能

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 14:12:00 HTTP/2.0 GET : https://f.mffb.com.cn/a/464072.html
  2. 运行时间 : 0.238907s [ 吞吐率:4.19req/s ] 内存消耗:4,920.68kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=b8024589c74f96b36009680de01d2a1c
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000670s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000593s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.003365s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000370s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000526s ]
  6. SELECT * FROM `set` [ RunTime:0.000195s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000567s ]
  8. SELECT * FROM `article` WHERE `id` = 464072 LIMIT 1 [ RunTime:0.003977s ]
  9. UPDATE `article` SET `lasttime` = 1770531120 WHERE `id` = 464072 [ RunTime:0.012065s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000348s ]
  11. SELECT * FROM `article` WHERE `id` < 464072 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000453s ]
  12. SELECT * FROM `article` WHERE `id` > 464072 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000428s ]
  13. SELECT * FROM `article` WHERE `id` < 464072 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003510s ]
  14. SELECT * FROM `article` WHERE `id` < 464072 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.012242s ]
  15. SELECT * FROM `article` WHERE `id` < 464072 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.025182s ]
0.242536s