•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
    • Status
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

如何閱讀tcpdump的輸出

  • Home
  • Client
  • Qa Forum
  • 如何閱讀tcpdump的輸出

Posted By: Manny | 1 Replies | Last Reply On: Jul 31, 2017 04:23:17

如何讀取tcpdump的輸出?

Psychz - Sachin

Votes: 0Posted On: Jul 31, 2017 04:23:17
 

 

Tcpdump is a tool used to analyze packets incident on a server. It runs under the command line and is a very useful network tool. It displays the packets(TCP/IP) transmitted or received by a network. Tcpdump is a free tool licensed under BSD license. You can also write the contents of tcpdump to a file. You will have to install tcpdump before start using it.

 

Installation

Please run the following commands to install "tcpdump".

Ubuntu/Debian family - apt-get install tcpdump

Centos/RHEL - yum install tcpdump

 

Tcpdump command with options

If you run the Tcpdump command without any options, the tcpdump will start displaying packets indefinitely until you suspend the operation. Here are some of the commonly used options.

 

Translating Hostnames and Ports

tcpdump -n

The "-n" option is used to translate the hostname and ports. Without this option, the output displays hostname which is converted to it's corresponding IP address.


A verbose output

tcpdump -v

The "-v" option stands for verbose. when you use the "-v" option, the output is displayed in a verbose manner. You can also use "v" multiple times for an even verbose output. For example - "tcpdump -vvvv".

 

Specifying  the number of packets

tcpdump -c 

The "-c" option is used to limit the number of packets to be captured. We can enter the number of packets we want to capture infront of the "-c" option. For example, the following command will capture 20 packets and suspend automatically. 

"tcpdump -c 20"

 

Specifying an interface

tcpdump -i 

The "-i" option lets you specify the network interface you want the packets to be captured from. There may be multiple network interfaces in a system. Use the "ifconfig" command to list all the interfaces. For example, the following command will capture the packets of "eth0" interface.

"tcpdump -i eth0"

 

Writing the output to file

tcpdump -w path_of_the_file

The "-w" option lets you write the output of tcpdump to a file which you can save for further analysis.

 

Reading the output from a file

tcpdump -r path_of_the_file

The "-r" option lets you read the output of a file. All you have to do is use the "-r" option with tcpdump command and specify the path of the file you want to read.

 

Capturing by Packet Size

tpcdump -s 

The "-s" option enables you to set the size of each packet to be captured. The default packet length is 65535 bytes. For example, the following command will capture the packets upto 100 bytes.

"tcpdump -s 100"


The "tcpdump" contains a variety of commands you can use to analyze the packets thoroughly. Once you have mastered these options, please go to the man page of tcpdump to view more about the command.

 

man tcpdump

Was this reply helpful?

Related topics

  • 頂級SQL數據庫
  • 防DDoS保護
  • 最常見的Linux發行版
  • 如何子網掩碼?
  • cVirtual Images
  • What are Redirects and Benefits of it
  • What Does NTP Mean?
  • The Ultimate Guide to Choosing the Best Data Center Location
  • SSD vs HDD Reliability
  • Mirai DDoS attacks- Then and Now
  • How to install an Operating System using the API?
  • How to create a new ticket?
  • How many servers can fit in a rack?
  • Hardware Based Firewall Solution
  • Create TXT record
Copyright © 2026 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
  • Catalog
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
  • Status
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801