Get the App
SLTechnology News&Howtos  ›  Development  › 

How does linux use the tcpdump command to monitor specified network packets

Shulou Source: shulou.com Published: 2022-06-01 03:59:59 09月30日 Update

This article mainly explains "how linux uses the tcpdump command to monitor specified network packets". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how linux uses the tcpdump command to monitor specified network packets.

Print all communication packets between the local host and the host on the berkeley network (nt: ucb-ether, which can be understood here as the network address of the 'berkeley network'. The original meaning of this expression can be expressed as: print all packets with a network address of ucb-ether)

The copy code is as follows:

Tcpdump net ucb-ether

Print all ftp packets that pass through the gateway snup (note that the expression is enclosed in single quotation marks, which prevents shell from incorrectly parsing the parentheses)

The copy code is as follows:

Tcpdump 'gateway snup and (port ftp or ftp-data)'

Print all ip packets whose source or destination address is the local host

If the local network is connected to another network through a gateway, the other network does not count as the local network. (nt: this sentence is translated with twists and turns, need to be added). Localnet should really be replaced with the name of the local network.)

The copy code is as follows:

Tcpdump ip and not net localnet

At this point, I believe you have a deeper understanding of "how linux uses the tcpdump command to monitor specified network packets". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Network data code address command monitoring host content actual expression learning original practical deeper tortuous between interest name meaning practicality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Apple Redmi Docker vpn