Skip to content

Instantly share code, notes, and snippets.

@tcpdump-examples
Last active February 15, 2021 09:41
Show Gist options
  • Save tcpdump-examples/fa4d9e3041900a7127246e03461cfcc7 to your computer and use it in GitHub Desktop.
Save tcpdump-examples/fa4d9e3041900a7127246e03461cfcc7 to your computer and use it in GitHub Desktop.
how-to-use-tcpdump.md.

How to use tcpdump to filter dhcp packets v4?

DHCP v4 traffic operates on port 67 (Server) and port 68 (Client). So we can capture the appropriate traffic with the following expression. (v4)

tcpdump -i eth0 udp port 67 or port 68 -vvv

How to use tcpdump to filter dhcpv6 packets?

DHCPv6 uses UDP port number 546 for clients and port number 547 for servers.

tcpdump -i eth0 -n -vv '(udp port 546 or port 547)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment