Puoi usare netstat e redirigerne l'output su file (anche se dovrai filtrare un po' i dati prima).