Network connection log

Asked by martino on 2010-03-19

I'm using ubuntu 9.10 and i'd like to know how to see the log of network connection with the port number
and IP address of the remote system.

Regards,

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
wojox
Solved:
2010-03-25
Last query:
2010-03-25
Last reply:
2010-03-22
wojox (wojox) said : #1

For what application?

For general stuff try:

sudo netstat -lntp

martino (lrinetti-libero) said : #2

My interest is about the history (log) of the connections, not only the present ones.

wojox (wojox) said : #3

There's also:

netstat -nr

-n means return numeric output (ie, IP address instead of hostname)

-r means print the routing table

find all open ports

netstat -a

find listening ports

netstat -l

There is no log unless your using a specific service/application.

martino (lrinetti-libero) said : #4

There are some service/application i can install that may help me ?

/var/log/ If it's not there then your application isn't keeping the log.
Perhaps add a router in there that will keep logs for you? (pfsense)

Best wojox (wojox) said : #6

If you have a router you can view ip addresses and port numbers through it.

martino (lrinetti-libero) said : #7

Thanks wojox, that solved my question.