Subject: Re: netstat-related command.
To: Armen Babikyan <armenb@lethargy.mit.edu>
From: SamMaEl <rimsky@teleport.com>
List: port-mac68k
Date: 04/22/1998 10:54:09
On Wed, 22 Apr 1998, Armen Babikyan wrote:

> Hi,
> 
> I'm wondering if there is a "netstat" command for all the connections
> running through my netbsd box on an IP-NAT-ed network.

	Somewhat, I guess ;-)

> my current setup at home has a powermac connected through a quadra 700 to
> the net, while the q700 is running ip-nat. however, when i ftp from my
> powermac out to the internet, I don't see an entry in netstat on my q700
> that pertains to the ftp connection my powermac made with a machine
> outside the internal network. my q700 is the router for the internal
> network.

	If you use the -l switch to ipnat (that is l as in 'el'), it will
give you a list of your MAP/Redirect filters as well as what sessions are
active. Here is a sample output (wrapped):

List of active MAP/Redirect filters:
map ppp0 192.168.1.0/24  -> 206.163.4.4/32  portmap tcp/udp 10000:65000
map ppp0 192.168.1.0/24  -> 206.163.4.4/32

List of active sessions:
MAP 192.168.1.3     2049  <- -> 206.163.4.4     10000 [192.108.254.12 23]
     8639790 300b

	The session is a telnet from 192.168.1.3 (my Q900) through my
Q630, who's ISP allocated IP is 206.163.4.4 to another UNIX machine on the
Internet with an IP of 192.108.254.12. And the 23 is the telnet port ;-) I
have no clue what the numbers/letters afterwards are though ;-)

	This probably isn't exactly what you meant, but it's one way of
seeing what's going through the nat.

	Ryan

-----
HELO... my name is rewt... you have SIGKILLed my father... prepare to vi!