Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74775 - netstat-nat does not display NAT connections
Summary: netstat-nat does not display NAT connections
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-17 13:15 UTC by Matthew Sutton
Modified: 2005-01-30 12:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for netstat-nat (fixes TCP and UDP Only) (patch.diff,7.60 KB, patch)
2004-12-20 22:32 UTC, Matthew Sutton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Sutton 2004-12-17 13:15:34 UTC
when I run netstat-nat on my gentoo gateway and there are nat connection preset it does not list anything.  I get this.
gentoo etc # netstat-nat
Proto NATed Address                  Foreign Address                State 
gentoo etc # 


Reproducible: Always
Steps to Reproduce:
1.build kernel to support NAT
2.build iptables rules to NAT
3.emerge netstat-nat
4.make a NAT connection through the gateway
5.run netstat-nat

Actual Results:  
it shows no connections.
although if I 'cat /proc/net/ip_conntrack'
it shows my NAT connections

Expected Results:  
formated the NAT connections into a user friendly view

# emerge info                                                                  
                                       
Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1,
2.6.9-gentoo-r9 i686)
=================================================================
System uname: 2.6.9-gentoo-r9 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/
http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="aalib adns apache2 avi bcmath berkdb bitmap-fonts chroot crypt cups encode
ethereal f77 fastcgi fbcon foomaticdb fortran freetds gd gdbm gif gpm imlib java
jpeg ldap libg++ libwww mad mbox mikmod milter mime mmx motif mpeg mysql mysqli
ncurses nls nocardbus nptl odbc oggvorbis opengl pam pcre pdflib perl php png
python quicktime readline samba sasl sdl simplexml slang sockets spell spl
sqlite sse ssl svga tcltk tcpd tiff truetype x86 xml xml2 xmlrpc xmms xv zlib"
Comment 1 Matthew Sutton 2004-12-20 22:32:30 UTC
Created attachment 46517 [details, diff]
patch for netstat-nat (fixes TCP and UDP Only)

This fixes displaying TCP and UDP connections.
netstat-nat is pulling the wrong parts of the array from buf[x]
I fixed it for TCP and UDP.  Need more info out of /proc/net/ip_conntrack
for ICMP and Unknow packets to show them correctly.
Comment 2 Daniel Black (RETIRED) gentoo-dev 2005-01-08 03:09:32 UTC
please attach a unified diff (diff -u)
Comment 3 Daniel Black (RETIRED) gentoo-dev 2005-01-25 00:27:12 UTC
version bumped to 1.4.4 - hope this fixes the problem. seems as though they have rewritten it as I can see no real match for where your patch applies to. Using unified (diff -u) puts useful info at the top like which file it appies to. Please use it in future.

Can you please comment if this newer version works.
Comment 4 Matthew Sutton 2005-01-25 05:45:15 UTC
emerged the new version this morning it is working great.
Comment 5 Daniel Black (RETIRED) gentoo-dev 2005-01-25 07:08:39 UTC
Sparc people - planning on removing netstat-nat-1.4.3.ebuild (stable sparc) as it refers to info at the wrong offset in the file. I doubt this is working on sparc either. 1.4.4 may work.
Comment 6 Jason Wever (RETIRED) gentoo-dev 2005-01-29 20:55:19 UTC
Both 1.4.3 and 1.4.4 work here for me.  Let me know when you want to bump it and I'll stablize.
Comment 7 Matthew Sutton 2005-01-30 08:18:06 UTC
bump
Comment 8 Daniel Black (RETIRED) gentoo-dev 2005-01-30 12:57:10 UTC
Jason - go for the 1.4.4 stabilisation and I'll catch up with the other arches. Thankyou