A quite handy tool for monitoring tcp traffic is tcptrack. Get it with:

and start it with

the interface parameter -i eth0 must be according to your needs, you can check your interfaces with ifconfig.

There is also tcpdump, tcpflow and other nice tools


Sometimes one like to figure out what programs listen at a port. Here we can get an overview with:

Where t=tcp, u=udp, p=show program name, l=show listening ports, n= numeric (not resolve machine names)
The Output could look something like this:



With lsof you can determine easily which program listens on a port and under which user that program runs:


Sometimes it happens that you can’t use your services cause they deal with blocked ports. For exampel you use mysql on the commandline and it is by some reason denied. A proxy can help you. Tsocks helps you to use a proxy. Tsocks is a library for intercepting outgoing network connections and redirecting them through a SOCKS server.

install tsocks with

Configure the file /etc/tsocks.conf

and finally call your command like this: