tcpdump

command module
v0.0.0-...-4261221 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 15 Imported by: 0

README

Pure Go tcpdump clone

Useful if you need a truly statically linked tcpdump-like tool for Linux. For example, this will run on Container-Optimized OS on GKE (Google Kubernetes Engine). This tool also includes integrated gzip support which can significantly reduce disk usage.

Install:

CGO_ENABLED=0 GOOS=linux go install github.com/iangudger/tcpdump@latest

Run:

$ $(go env GOPATH)/bin/tcpdump -h
~/go/bin/tcpdump [flags]
  -gzip
      Compress output with gzip compression.
  -h  Print usage.
  -help
      Print usage.
  -i string
      Interface to read packets from. (default "any")
  -len uint
      Max packet length. (default 65536)
  -out string
      Path to output file in pcap format. (Default is a randomly generated directory in /tmp)
$ sudo $(go env GOPATH)/bin/tcpdump
2024/02/05 09:48:45 Saving capture to: /tmp/3966175455/dump.pcap
2024/02/05 09:48:45 Capturing from all interfaces

Documentation

Overview

Tcpdump is a Go clone of the popular tcpdump tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL