Record network traffic with the Raspberry Pi (tcpdump)

A Raspberry Pi configured as man-in-the-middle should record the network traffic. For example, to find errors in a network communication. The data traffic should be written to a file for later evaluation with Wireshark.
task