Tcpdump Container Network Traffic

Get pod host IP and container ID

kubectl get po podName -o yaml -n namespace

// save host ip, container id

SSH to host where pod is running. Get container interface id

docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink'

// save interface index

On the host, get interface

ip link |grep ^index:

// get interface name

Tcpdump interface

tcpdump -i interface

Leave a Reply

Your email address will not be published. Required fields are marked *