Skip to content

Running tcpdump in docker and write dumps to ring buffer on volume

Notifications You must be signed in to change notification settings

CoRfr/tcpdump-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

tcpdump docker container

This simple image runs a tcpdump and writes dumps to the volume /data. It will keep at max 10x 1GB files and overwrite the oldest one.

To capture on the hosts network interfaces, you need to run the container by using the host networking mode:

$ docker run --net=host corfr/tcpdump

To specify filters or interface, you can use this image as you would use tcpdump, but this will override default parameters:

$ docker run --net=host corfr/tcpdump -i eth2 port 80

If you want storage to happen on your host: (the important part is to mount the volume using docker -v, and to write data in that volume using tcpdump -w)

$ docker run --net=host -v $PWD:/data corfr/tcpdump -i any -w /data/dump.pcap "icmp"

To analyze the stream live remotely from wireshark: (don't forget to filter out traffic on port 22)

$ ssh root@remote-host "docker run --rm --net=host corfr/tcpdump -i any -w - not port 22 2>/dev/null" |wireshark -k -i -

About

Running tcpdump in docker and write dumps to ring buffer on volume

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published