Netstat-nat


Description:

Netstat-nat is a small program written in C. It displays NAT connections, managed by netfilter/iptables which comes with the > 2.4.x linux kernels. The program reads its information from '/proc/net/ip_conntrack' or '/proc/net/nf_conntrack', which is the temporary conntrack-storage of netfilter. (http://www.netfilter.org/)

*note*
Now a days the procfs interface is considered obsolete in favor of using the conntrack tool which used Netlink. If you still want to use the tool you have to enable NF_CONNTRACK_PROCFS and compile your own kernel.

Netstat-nat takes several arguments (but not needed).
  
-hdisplays help
-ndon't resolve IPs/ports to host/portnames.
-p 'protocol'display NAT connections with protocol selection.
-s 'source host'display connections by source IP/hostname.
-d 'destination host'display connections by destination IP/hostname.
-Sdisplay SNAT connections
-Ddisplay DNAT connections
-Ldisplay only connections to NAT box self (disables display of SNAT & DNAT)
-Rdisplay only connections routed through the NAT box (doesn't show SNAT & DNAT)
-xextended view of hostnames
-r src | dst | src-port | dst-port | state  sort connections
-ostrip output-header
-Ndisplay NAT box connection information (IP and port) for NATing iface (only valid with SNAT & DNAT)
-vversion

Tar.gz files:

netstat-nat-1.4.10.tar.gz
netstat-nat-1.4.9.tar.gz
netstat-nat-1.4.8.tar.gz
netstat-nat-1.4.7.tar.gz
netstat-nat-1.4.6.tar.gz
netstat-nat-1.4.5.tar.gz
netstat-nat-1.4.4.tar.gz
netstat-nat-1.4.3.tar.gz
netstat-nat-1.4.2.tar.gz
netstat-nat-1.4.1.tar.gz
netstat-nat-1.4.tar.gz
netstat-nat-1.3.1.tar.gz
netstat-nat-1.3.tar.gz (broken)
netstat-nat-1.2.1.tar.gz
netstat-nat-1.2.tar.gz
netstat-nat-1.1.tar.gz
netstat-nat-1.0.tar.gz
RPM files:

netstat-nat-1.4.9-1.i586.rpm (SuSE)
netstat-nat-1.4.9-1.src.rpm (SuSE)

netstat-nat-1.4.7-1.i586.rpm (SuSE)
netstat-nat-1.4.7-1.src.rpm (SuSE)

netstat-nat-1.4.6-1.i586.rpm (SuSE)
netstat-nat-1.4.6-1.src.rpm (SuSE)

netstat-nat-1.4.5-1.i586.rpm (SuSE)
netstat-nat-1.4.5-1.src.rpm (SuSE)

netstat-nat-1.4.4-1.i386.rpm (SuSE)
netstat-nat-1.4.4-1.src.rpm (SuSE)

netstat-nat-1.4.3-1.i386.rpm
netstat-nat-1.4.3-1.src.rpm

netstat-nat-1.4.2-1.i386.rpm
netstat-nat-1.4.2-1.src.rpm

netstat-nat-1.4.1-2.src.rpm (.spec file patch, not included in tar.gz, only available in CVS and in this package)

netstat-nat-1.4.1-1.i386.rpm
netstat-nat-1.4.1-1.src.rpm

netstat-nat-1.4-1.i386.rpm
netstat-nat-1.4-1.src.rpm

netstat-nat-1.3.1-1.i386.rpm
netstat-nat-1.3.1-1.src.rpm

netstat-nat-1.2-1.i386.rpm or netstat-nat-1.2-1.i386.rpm
netstat-nat-1.2-1.src.rpm or netstat-nat-1.2-1.src.rpm
(tested on RH7.2 and 7.3 till version 1.4.3)
(as from version 1.4.4 packaged and tested for SuSE (9.0), use the src.rpm to build for your own distro)


Deb files:

netstat-nat-1.4.7-1.i586.deb (Debian) (created by Supaflyster)

ipkg files (optware):

netstat-nat_1.4.10-1_mipsel.ipk (compiled against dd-wrt if.h)

The install:

Current installation guide

If you have a older version than 1.3 look overhere.

For the rpm installation go here
Thanks:

Thanks goes to Marceln who contributed the manpage and the v1.2 rpm-files, and for submitting a patch for v1.4.1 which removes unused variables, included a more understandable memory allocate error and making netstat-nat compatible with uLibC.
Jose Pedro Oliveira who submitted a .spec file patch (v1.4.1-2), which removes a couple of rpmlint warnings
Gumundur D. Haraldsson for submitting a patch which does a more properly memory allocation and saver copies of variables. (merged in v1.4.3)
Supaflyster for submitting patch for proper read-in on some systems and pointing out dnat over snat connections problem, which weren't shown in output. (v1.4.7)
and others who submitted suggestions.
Change log:

Changelog

CVS tree:

CVS files
Contact:

D.Wijsman danny@tweegy.nl