Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using a Ubuntu machine as a NAT router. How can I find out the following:

  • the ports on which the LAN machines are listening or communicating (both tcp and udp);
  • which local machines have established connections with which WAN ip's on those ports;
  • and the size of data that has been transfered on those ports.
share|improve this question

3 Answers 3

up vote 1 down vote accepted

I think you want to try netstat-nat I seem to remember using it when I had a Slackware box set up as a NAT-server.

share|improve this answer

sudo iftop

sudo netstat -ntlp

sudo tcpdump -i /dev/ethX

share|improve this answer

You could also try "lsof " with a combination of different flags one in particular "-i" , if you don't have the package , see that you install it, the data displayed is easily read and can give you a good insight about whats happening on your network.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.