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

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

## 安装

```sh
sudo av install brew:iptables
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install iptables
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add iptables
```

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

- Debian apt (92%):

```sh
sudo apt install iptables
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#iptables
```

  证据: nixpkgs package indexes: pkgs/by-name/ip/iptables/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S iptables
```

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

- zypper (92%):

```sh
sudo zypper install iptables
```

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

- dnf (92%):

```sh
sudo dnf install iptables-devel
```

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

## 软件包事实

- **软件包键:** brew:iptables
- **软件包管理器:** Homebrew
- **版本:** 1.8.13
- **来源摘要:** Linux kernel packet control tool
- **主页:** <https://www.netfilter.org/projects/iptables/index.html>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- arptables (别名)
- arptables-nft (别名)
- arptables-nft-restore (别名)
- arptables-nft-save (别名)
- arptables-restore (别名)
- arptables-save (别名)
- arptables-translate (别名)
- ebtables (别名)
- ebtables-nft (别名)
- ebtables-nft-restore (别名)
- ebtables-nft-save (别名)
- ebtables-restore (别名)
- ebtables-save (别名)
- ebtables-translate (别名)
- ip6tables (别名)
- ip6tables-apply (别名)
- ip6tables-legacy (别名)
- ip6tables-legacy-restore (别名)
- ip6tables-legacy-save (别名)
- ip6tables-nft (别名)
- ip6tables-nft-restore (别名)
- ip6tables-nft-save (别名)
- ip6tables-restore (别名)
- ip6tables-restore-translate (别名)
- ip6tables-save (别名)
- ip6tables-translate (别名)
- iptables (别名)
- iptables-apply (别名)
- iptables-legacy (别名)
- iptables-legacy-restore (别名)
- iptables-legacy-save (别名)
- iptables-nft (别名)
- iptables-nft-restore (别名)
- iptables-nft-save (别名)
- iptables-restore (别名)
- iptables-restore-translate (别名)
- iptables-save (别名)
- iptables-translate (别名)
- iptables-xml (别名)
- nfbpf_compile (别名)
- nfnl_osf (别名)
- xtables-legacy-multi (别名)
- xtables-monitor (别名)
- xtables-nft-multi (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

iptables is the long-lived user-space command family for controlling Linux packet filtering, NAT, and mangling rules through the netfilter framework. It sits at the intersection of kernel networking, firewall administration, and distribution packaging, with companion commands such as ip6tables, arptables, ebtables, restore/save tools, and nft translation frontends.

### 项目历史

The netfilter project was founded by Paul "Rusty" Russell as a redesign of the Linux 2.2 ipchains and Linux 2.0 ipfwadm firewall systems. Netfilter's own project history describes the late-1999 design work by Russell and Marc Boucher that generalized iptables and produced the multiple-table framework that became the filter, nat, and mangle modules.

iptables became the administrative surface for the Linux 2.4 era of packet filtering. The project grew alongside connection tracking, NAT helpers, userspace queueing, IPv6 work through ip6tables, and later the xtables command family that collected IPv4, IPv6, ARP, and Ethernet bridge filtering tools under related interfaces.

The iptables 1.8 series marked the nftables transition period by shipping both legacy xtables commands and nft-backed variants such as iptables-nft, ip6tables-nft, arptables-nft, ebtables-nft, and translation tools. That made iptables both a historic interface and a migration bridge to nftables.

### 采用历史

iptables was adopted broadly because it arrived with the Linux kernel's netfilter subsystem and offered a scriptable firewall language that distributions, hosting providers, routers, container stacks, and security appliances could automate. Its save/restore format made rulesets easy to ship in init scripts and configuration management.

The package remains visible in package-manager culture because many Linux systems, compatibility scripts, and container/networking components still know the iptables command vocabulary even when the underlying backend is nftables. Homebrew's package metadata also exposes the full command family for macOS users who need the Linux-compatible tooling.

### 使用方式

Typical use centers on creating chains and rules for packet filtering, network address translation, port forwarding, connection-state matching, and firewall persistence with iptables-save and iptables-restore. Administrators also use iptables-translate and iptables-restore-translate when moving legacy rule sets toward nftables.

The package is Linux-specific in purpose: on non-Linux systems it is mostly useful for packaging, cross-development, documentation, or compatibility workflows rather than native packet filtering.

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

For package nerds, iptables is one of the canonical examples of a small command-line package whose real meaning comes from the kernel ABI underneath it. Its packaging has to preserve many executable names because shell scripts, orchestration tools, and documentation often reference exact command variants.

It is also a transition fossil: one package contains legacy commands, nft-backed commands, multi-call binaries, and translation helpers, making it a compact map of two generations of Linux firewall administration.

### 时间线

- 1999: Netfilter core design work generalized iptables and the filter, nat, and mangle table model.
- 2000: Netfilter and iptables work was prepared for inclusion with Linux 2.4.
- 2001: Linux 2.4 made netfilter/iptables the standard Linux firewall framework.
- 2018: iptables 1.8 introduced the nft-backed command variants as part of the nftables migration path.
- 2026: Netfilter news records continued iptables 1.8 maintenance releases.

### Related projects

- iptables is closely related to netfilter kernel hooks, nftables, libnftnl, conntrack-tools, ipset, ulogd, arptables, ebtables, and the older ipchains and ipfwadm systems it replaced.

### 来源

- <https://formulae.brew.sh/formula/iptables>
- <https://git.netfilter.org/iptables>
- <https://www.netfilter.org/about.html>
- <https://www.netfilter.org/projects/iptables/index.html>
- <https://www.netfilter.org/projects/nftables/index.html>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - iptables - 1.8.11-2: normalized package name match | Debian stable package indexes: iptables from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | administration tools for packet filtering and NAT | https://www.netfilter.org/
- Debian apt - libip4tc-dev - 1.8.11-2: normalized package name match | Debian stable package indexes: libip4tc-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for libip4tc | https://www.netfilter.org/
- Debian apt - libip4tc2 - 1.8.11-2: normalized package name match | Debian stable package indexes: libip4tc2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | netfilter libip4tc library | https://www.netfilter.org/
- Debian apt - libip6tc-dev - 1.8.11-2: normalized package name match | Debian stable package indexes: libip6tc-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for libip6tc | https://www.netfilter.org/
- Debian apt - libip6tc2 - 1.8.11-2: normalized package name match | Debian stable package indexes: libip6tc2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | netfilter libip6tc library | https://www.netfilter.org/
- Debian apt - libiptc-dev - 1.8.11-2: normalized package name match | Debian stable package indexes: libiptc-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Common development files for libiptc | https://www.netfilter.org/
- Debian apt - libxtables-dev - 1.8.11-2: normalized package name match | Debian stable package indexes: libxtables-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | netfilter xtables library -- development files | https://www.netfilter.org/
- Debian apt - libxtables12 - 1.8.11-2: normalized package name match | Debian stable package indexes: libxtables12 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | netfilter xtables library | https://www.netfilter.org/
- Nix - iptables: normalized package name match | nixpkgs package indexes: pkgs/by-name/ip/iptables/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - iptables - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: iptables from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | administration tools for packet filtering and NAT | https://www.netfilter.org/
- Ubuntu apt - libip4tc-dev - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libip4tc-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for libip4tc | https://www.netfilter.org/
- Ubuntu apt - libip4tc2 - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libip4tc2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | netfilter libip4tc library | https://www.netfilter.org/
- Ubuntu apt - libip6tc-dev - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libip6tc-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for libip6tc | https://www.netfilter.org/
- Ubuntu apt - libip6tc2 - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libip6tc2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | netfilter libip6tc library | https://www.netfilter.org/
- Ubuntu apt - libiptc-dev - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libiptc-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Common development files for libiptc | https://www.netfilter.org/
- Ubuntu apt - libxtables-dev - 1.8.10-3ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libxtables-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | netfilter xtables library -- development files | https://www.netfilter.org/


## Combined YAML source

View the package source record on GitHub. [combined/iptables.yml](https://github.com/mxcl/pkgdb/blob/main/combined/iptables.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
