Why tcpdump don't work?

Chuck Swiger cswiger at mac.com
Fri Aug 29 05:27:03 UTC 2008


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



More information about the freebsd-questions mailing list