Take the tour ×

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
add comment

3 Answers

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
add comment

sudo iftop

sudo netstat -ntlp

sudo tcpdump -i /dev/ethX

share|improve this answer
add comment

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
add comment

Your Answer


