# Install libnet with Homebrew, apk, dnf, MacPorts, Nix, pacman, apt, zypper

C library for creating IP packets. Version 1.3 via Homebrew; verified from local package data. Also installable with debian: sudo apt install libnet1.

## Install

```sh
sudo av install brew:libnet
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install libnet
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libnet
```

  Evidence: MacPorts ports tree: net/libnet/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add libnet
```

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

- dnf (92%):

```sh
sudo dnf install libnet
```

  Evidence: Fedora Rawhide package metadata: libnet 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#libnet
```

  Evidence: nixpkgs package indexes: pkgs/by-name/li/libnet/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S libnet
```

  Evidence: Arch Linux sync databases: libnet from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Debian apt (92%):

```sh
sudo apt install libnet1
```

  Evidence: Debian stable package indexes: libnet1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install libnet-devel
```

  Evidence: openSUSE Tumbleweed package metadata: libnet-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:libnet
- **Package manager:** Homebrew
- **Version:** 1.3
- **Source summary:** C library for creating IP packets
- **Homepage:** <https://codedocs.xyz/libnet/libnet/>
- **Repository:** <https://github.com/libnet/libnet>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- libnet-config (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 1.3
## Project history and usage

libnet is a C library for constructing and injecting network packets. It occupies the low-level packet-building side of the classic libpcap/libnet pairing: libpcap captures packets, while libnet gives test tools, scanners, and protocol experiments a portable API for emitting packets with controlled headers.

### Project history

The project traces its 1.1 line to Mike D. Schiffman's Packetfactory-era work, with project materials crediting libnet 1.1 to 1998-2004. The maintained 1.1.3-and-later line was revived by Sam Roberts starting in 2009 after the older Packetfactory-hosted code had become unmaintained.

The 1.1 API was a significant break from 1.0.x code. The migration guide describes the change as a simplification from a five-step packet workflow to initialization, packet building, and packet writing, and the README warns that libnet 1.0.x code is incompatible with libnet 1.1.x and later.

### Adoption history

libnet spread through security and networking tools because it hides byte ordering, buffer management, and link/IP layer packet assembly details while still allowing deliberate packet shaping. The official README names packaged tools such as arping, ettercap, nemesis, packit, tcptraceroute, and yersinia as libnet users.

### How it is used

Developers include libnet through libnet.h and link with -lnet. The project retained libnet-config for compatibility but moved new integration guidance toward pkg-config, with libnet.pc replacing the older helper in modern builds.

### Why package nerds care

For package maintainers, libnet is notable because it is tiny in concept but sits on privileged and platform-specific network interfaces. Its ABI break between 1.0.x and 1.1.x, the revival from an abandoned upstream, and the long-lived libnet-config compatibility shim are exactly the sort of details that explain why distributions keep careful split packages and rebuild notes for it.

### Timeline

- 1998-2004: libnet 1.1 materials credit Mike D. Schiffman for the Packetfactory-era implementation.
- 2009: Sam Roberts began maintaining the 1.1.3-and-later line after the older upstream had gone quiet.
- 2012: libnet 1.1.6 appeared in the SourceForge-hosted release area.
- 2023: GitHub listed libnet v1.3 as a release dated October 2, 2023.

### Related projects

- libpcap is the natural companion library for capture-side workflows.
- Packet-generation and network-security tools named by the project include arping, ettercap, nemesis, packit, tcptraceroute, and yersinia.

### Sources

- <https://github.com/libnet/libnet>
- <https://github.com/libnet/libnet/blob/master/doc/MIGRATION.md>
- <https://sourceforge.net/projects/libnet-dev/files/>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Other Package-Manager Records

- Debian apt - libnet1 - 1.3+dfsg-2: normalized package name match | Debian stable package indexes: libnet1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library for the construction and handling of network packets | https://github.com/libnet/libnet/
- Debian apt - libnet1-dev - 1.3+dfsg-2: normalized package name match | Debian stable package indexes: libnet1-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development files for libnet | https://github.com/libnet/libnet/
- Debian apt - libnet1-doc - 1.3+dfsg-2: normalized package name match | Debian stable package indexes: libnet1-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | developers documentation files for libnet | https://github.com/libnet/libnet/
- Nix - libnet: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libnet/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libnet1 - 1.1.6+dfsg-3.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnet1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | library for the construction and handling of network packets | http://libnet-dev.sourceforge.net/
- Ubuntu apt - libnet1-dbg - 1.1.6+dfsg-3.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnet1-dbg from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | debugging symbols for libnet | http://libnet-dev.sourceforge.net/
- Ubuntu apt - libnet1-dev - 1.1.6+dfsg-3.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnet1-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | development files for libnet | http://libnet-dev.sourceforge.net/
- Ubuntu apt - libnet1-doc - 1.1.6+dfsg-3.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnet1-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | developers documentation files for libnet | http://libnet-dev.sourceforge.net/
- apk - libnet - 1.3-r0: normalized package name match | Alpine Linux edge package indexes: libnet from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A generic networking API that provides access to several protocols. | https://sourceforge.net/projects/libnet-dev/
- apk - libnet-dev - 1.3-r0: normalized package name match | Alpine Linux edge package indexes: libnet-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A generic networking API that provides access to several protocols. (development files) | https://sourceforge.net/projects/libnet-dev/
- apk - libnet-doc - 1.3-r0: normalized package name match | Alpine Linux edge package indexes: libnet-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A generic networking API that provides access to several protocols. (documentation) | https://sourceforge.net/projects/libnet-dev/
- apk - libnet-static - 1.3-r0: normalized package name match | Alpine Linux edge package indexes: libnet-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A generic networking API that provides access to several protocols. (static library) | https://sourceforge.net/projects/libnet-dev/
- dnf - libnet - 1.3-8.fc45: normalized package name match | Fedora Rawhide package metadata: libnet from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | C library for portable packet creation and injection | https://github.com/libnet/libnet
- dnf - libnet-devel - 1.3-8.fc45: normalized package name match | Fedora Rawhide package metadata: libnet-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for the libnet library | https://github.com/libnet/libnet
- dnf - libnet-doc - 1.3-8.fc45: normalized package name match | Fedora Rawhide package metadata: libnet-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Documentation files for the libnet library | https://github.com/libnet/libnet
- pacman - libnet - 2:1.3-2: normalized package name match | Arch Linux sync databases: libnet from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A library which provides API for commonly used low-level net functions | https://github.com/libnet/libnet


## Combined YAML source

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


## Sources

- 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
