Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2008 22:27:00 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        EdwardKing <zhangsc@neusoft.com>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: Why tcpdump don't work?
Message-ID:  <3DCA0239-52B5-4B04-8FAB-730FBAF85450@mac.com>
In-Reply-To: <032001c90994$8cb3e760$3f83a8c0@neusofteaf5839>
References:  <032001c90994$8cb3e760$3f83a8c0@neusofteaf5839>

next in thread | previous in thread | raw e-mail | index | archive | help
Howdy--

On Aug 28, 2008, at 10:03 PM, EdwardKing wrote:
> I have a server and a client,they use TCP to communication.For  
> example,when client send a message to server,the server return the  
> same message to client,then client show it.When client or server  
> shutdown,it will send FIN.So I want to use tcpdump to watch it. The  
> server and client in the same machine,the IP is 172.0.10.2 and the  
> port is 9999
> [ ... ]
> when client and server communication or client shutdown,tcpdump  
> don't show any message!
> Why? I am very puzzle with it!  How to show server and client tcp  
> communication information by using tcpdump?

If both client and server are running on the same machine, then the  
network traffic doesn't actually go through your le0 network  
interface-- instead, it uses the loopback interface, lo0, on IP  
127.0.0.1.  Try something more like:

   tcpdump -i lo0 -v tcp port 9999

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DCA0239-52B5-4B04-8FAB-730FBAF85450>