# 使用 Homebrew, apk, apt, dnf, Nix, pacman, zypper 安装 nftables

查看 nftables 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:nftables
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nftables
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add nftables
```

  证据: Alpine Linux edge package indexes: nftables from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install nftables
```

  证据: Debian stable package indexes: nftables from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install nftables
```

  证据: Fedora Rawhide package metadata: nftables from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#nftables
```

  证据: nixpkgs package indexes: nftables from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S nftables
```

  证据: Arch Linux sync databases: nftables from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install nftables
```

  证据: openSUSE Tumbleweed package metadata: nftables from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:nftables
- **软件包管理器:** Homebrew
- **版本:** 1.1.6
- **来源摘要:** Netfilter tables userspace tools
- **主页:** <https://netfilter.org/projects/nftables/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nft (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.1.6
## 项目历史与用法

nftables is the Netfilter project's replacement for the older iptables, ip6tables, arptables, and ebtables command families. It combines a new in-kernel packet classification framework with the `nft` userspace command and libnftables library, while reusing Netfilter pieces such as hooks, connection tracking, NAT, queueing, and logging.

### 项目历史

The nftables design was publicly presented at Netfilter Workshop 2008 and released publicly in March 2009 by Patrick McHardy. It was developed to reduce duplicated packet-filtering code and make extension easier than the separate xtables-era tools.

nftables was selected for Linux 3.13 in 2013 and became available upstream with the Linux 3.13 kernel line in January 2014. The official project page describes the replacement target, the new VM-based ruleset model, and the separate userspace command-line tool.

### 采用历史

The migration was intentionally gradual because firewall rules are operational infrastructure. The project provides an iptables/ip6tables compatibility layer over the nftables infrastructure, and distributions have used that bridge to move old command syntaxes onto the newer kernel backend.

By the Debian 10 and RHEL 8 era, nftables had moved from future replacement to default low-level packet-filtering framework in major Linux distributions. Red Hat documents nftables as the successor to iptables, ip6tables, arptables, ebtables, and ipset, and recommends it when administrators need direct control beyond high-level firewalld scenarios.

### 使用方式

Admins use `nft` to create tables, chains, sets, maps, NAT rules, and packet filters in a single syntax across address families. The package is most useful when you need explicit rulesets, performance-friendly sets/maps, atomic ruleset replacement, or a firewall that is easier to reason about than layered iptables invocations.

Package nerds care about which backend their distro's `iptables` command actually targets. On newer systems, `iptables-nft` compatibility may be present even when scripts still look old, while serious new rulesets are usually written as `/etc/nftables.conf` and loaded by the nftables service or by distribution firewall tooling.

### 为什么软件包爱好者会关心

nftables is one of the big Linux plumbing migrations: not a flashy app, but a shift in how packet filtering, NAT, and firewall state are represented. Its packaging matters because kernel version, libmnl, libnftnl, the `nft` tool, and distribution compatibility alternatives all have to line up.

### 时间线

- 2008: nftables was presented at Netfilter Workshop in Paris.
- 2009-03: Patrick McHardy announced the first public nftables release.
- 2013-10: nftables was selected for Linux 3.13.
- 2014-01: Linux 3.13 made nftables available upstream.
- 2019: Debian 10 and RHEL 8 generation distributions made nftables a default or primary low-level firewall backend.

### Related projects

- Netfilter
- iptables
- ip6tables
- arptables
- ebtables
- firewalld
- libmnl
- libnftnl

### 来源

- <https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_firewalls_and_packet_filters/getting-started-with-nftables_firewall-packet-filters>
- <https://formulae.brew.sh/formula/nftables>
- <https://netfilter.org/projects/nftables/>
- <https://people.netfilter.org/pablo/netdev0.1/slides/nftables-netdev-2015.pdf>
- <https://wiki.nftables.org/wiki-nftables/index.php/List_of_updates_since_Linux_kernel_3.13>
- <https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables>
- <https://wiki.nftables.org/wiki-nftables/index.php/What_is_nftables%3F>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - libnftables-dev - 1.1.3-1: normalized package name match | Debian stable package indexes: libnftables-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for libnftables | https://www.netfilter.org/
- Debian apt - libnftables1 - 1.1.3-1: normalized package name match | Debian stable package indexes: libnftables1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Netfilter nftables high level userspace API library | https://www.netfilter.org/
- Debian apt - nftables - 1.1.3-1: normalized package name match | Debian stable package indexes: nftables from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Program to control packet filtering rules by Netfilter project | https://www.netfilter.org/
- Debian apt - python3-nftables - 1.1.3-1: normalized package name match | Debian stable package indexes: python3-nftables from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | nftables/libnftables python3 module | https://www.netfilter.org/
- Nix - nftables: normalized package name match | nixpkgs package indexes: nftables from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - libnftables-dev - 1.0.9-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnftables-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for libnftables | https://www.netfilter.org/
- Ubuntu apt - libnftables1 - 1.0.9-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnftables1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Netfilter nftables high level userspace API library | https://www.netfilter.org/
- Ubuntu apt - nftables - 1.0.9-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: nftables from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Program to control packet filtering rules by Netfilter project | https://www.netfilter.org/
- Ubuntu apt - python3-nftables - 1.0.9-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-nftables from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | nftables/libnftables python3 module | https://www.netfilter.org/
- apk - nftables - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools | https://netfilter.org/projects/nftables
- apk - nftables-dev - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools (development files) | https://netfilter.org/projects/nftables
- apk - nftables-doc - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools (documentation) | https://netfilter.org/projects/nftables
- apk - nftables-openrc - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools (OpenRC init scripts) | https://netfilter.org/projects/nftables
- apk - nftables-rulesets - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-rulesets from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Meta package for pulling in all nftables rulesets | https://netfilter.org/projects/nftables
- apk - nftables-static - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools (static library) | https://netfilter.org/projects/nftables
- apk - nftables-systemd - 1.1.6-r1: normalized package name match | Alpine Linux edge package indexes: nftables-systemd from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netfilter tables userspace tools (systemd files) | https://netfilter.org/projects/nftables


## 相关链接

- [nftables](https://pkg.so/zh-hans/pkg/cargo/nftables/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/nftables.yml](https://github.com/mxcl/pkgdb/blob/main/combined/nftables.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
