In Linux, tcpdump is saved and the result is pcap file wireshark analysis.

Source: Internet
Author: User
The command parameter for saving tcpdump packets to a file is-wxxx. cap capture eth1 package tcpdump-ieth1-w/tmp/xxx. cap catch 192.168.1.123 package tcpdump-ieth1host192.168.1.123-w/tmp/xxx. cap catch 192.168.1.123 port 80 package tcpdump-ieth1ho

TcpdumpThe command parameter for saving a packet to a file is-w xxx. cap.

Capture the eth1 package

Tcpdump-I eth1-w/tmp/xxx. cap

Capture the packet of 192.168.1.123

Tcpdump-I eth1 host 192.168.1.123-w/tmp/xxx. cap

Capture Port 80 of 192.168.1.123

Tcpdump-I eth1 host 192.168.1.123 and port 80-w/tmp/xxx. cap

Capture the icmp packet of 192.168.1.123

Tcpdump-I eth1 host 192.168.1.123 and icmp-w/tmp/xxx. cap

Capture packets of port 80 of 192.168.1.123 and ports other than 110 and 25

Tcpdump-I eth1 host 192.168.1.123 and! Port 80 and! Port 25and! Port 110-w/tmp/xxx. cap

Capture vlan 1 packets

Tcpdump-I eth1 port 80 and vlan 1-w/tmp/xxx. cap

Capture pppoe password

Tcpdump-I eth1 pppoes-w/tmp/xxx. cap

Save the file in 100 MB, and open a file larger than MB-C MB

Capture 10000 packets and exit-c 10000

Packet capture in the background, and the exit of the console will not be affected:

Nohup tcpdump-I eth1 port 110-w/tmp/xxx. cap &

You can use ethereal or wireshark to open the captured file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.