Daily tip

How can I trace a full TCP segment for diagnosis purposes?

By installing tcpdump and using it with the below command syntax (you must be root or have sudo permissions).

#tcpdump -vvv [-i ] [port|host] -nnXSs 0

For instance, if you want to see in details what happens with any connection to and from the local web server (port 80) you type

#tcpdump -vvv -i any port 80 -nnXSs 0

Note that -i any means that tcpdump is listening on any network interface.