SUSE LINUX Enterprise & openSUSE Community
กรกฎาคม 23, 2019, 06:24:22 PM *
ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
   หน้าแรก   ช่วยเหลือ ค้นหา เข้าสู่ระบบ สมัครสมาชิก  

[Why we need your support] SUSE and openSUSE are trademarks of Attachmate Group, Inc. - WE ARE NOT IN ANY WAY ASSOCIATED WITH SUSE AND ATTACHMATE GROUP. is a SUSE Linux user and community found in Thailand but not limited to other country suse linux user to join in. Currently active contents (How to's, Scripts, Tips, Tricks, Tutorials, Linux Command Line, and Troubleshooting) this suse linux how to's and expert support are SUSE Linux.
หน้า: [1]   ลงล่าง
หัวข้อ: packet trace on using tcpdump  (อ่าน 4663 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
Expert : ผู้เชี่ยวชาญ

Karma: +1/-0
ออฟไลน์ ออฟไลน์

กระทู้: 1931


« เมื่อ: กุมภาพันธ์ 03, 2014, 01:17:03 PM »

Taking a packet trace on Linux using tcpdump

Novell SUSE Linux Enterprise Desktop (SLED)
Novell SUSE Linux Enterprise Server (SLES)
Novell Open Enterprise Server 2 (OES 2)
Novell openSUSE

How to take a packet trace (LAN trace, packet capture) from Linux using tcpdump.

tcpdump -i eth0 -s0 -w /tmp/capture.cap

-i eth0 = The interface to capture on, if there is only one interface this is not needed.
-s0 = Captures maximum size of packets, without this packets will possibly be truncated.
-w /tmp/capture.cap = Output file for capture

[Please note, this is not an exhaustive list of options, but it covers the basics.  Check the man pages for a complete list]

Additional Information
To create a rolling trace, for situation where you are trying to capture a random issue without filling up the partition space, various command options are available.  We recommend the following (these are case-sensitive):
-C file_size (in millions of bytes (1,000,000 bytes, not 1,048,576 bytes).
-W count -- Used in conjunction with -C, this will limit the number of files created to the specified number, overwriting files from the beginning, thus creating a rotating buffer.
tcpdump -i <eth device> -s 0 -C <file_size> -W <number of files> -w </path/to/trace.cap>
For roughly 9.6 MB files, rotating through three files, the following command is used:
tcpdump -i eth0 -s 0 -C 10 -W 3 -w /home/myTrace.cap

You will see the following traces being created:
After myTrace.cap2 is full, the tcpdump command will overwrite myTrace.cap0
For roughly 955 MB files, rotating through 8 files, use the following:
tcpdump -i eth0 -s 0 -C 1000 -W 8 -w /some/other/location/serverTrace.cap

You will see the following traces created:
.... and so on
When dealing with larger traces, and trying to capture a specific issue, it is usually not necessary to send in all of the traces to Novell support.  Typically the issue will be in the last one or two traces (depending on the settings used and the amount of traffic on the wire at the time).
Ethereal or Wireshark can also be used on Linux to take a packet trace.  See the following TID for more detail:
3892415 - How to use Wireshark to capture a packet trace

Reference: TID 7001152
แจ้งลบกระทู้นี้หรือติดต่อผู้ดูแล   บันทึกการเข้า

ageLOC Technology
หน้า: [1]   ขึ้นบน

(@)2007 SUSE Linux user community found in Thailand. This site is not an official openSUSE and SUSE website, and is not in any way affiliated with or endorsed by SUSE Linux GmbH or Novell. openSUSE and SUSE are trademarks of Novell, Inc. in the United States and other countries.
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
หน้านี้ถูกสร้างขึ้นภายในเวลา 0.026 วินาที กับ 22 คำสั่ง (Pretty URLs adds 0.006s, 2q)