mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
//Module included in the following assemblies:
|
|
//
|
|
// observability/network_observability/netobserv_cli/netobserv-cli-using.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="network-observability-cli-capturing-packets_{context}"]
|
|
= Capturing packets
|
|
|
|
You can capture packets using the Network Observability CLI.
|
|
|
|
.Prerequisites
|
|
* Install the {oc-first}.
|
|
* Install the Network Observability CLI (`oc netobserv`) plugin.
|
|
|
|
.Procedure
|
|
. Run the packet capture with filters enabled:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc netobserv packets --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
|
|
----
|
|
. Add filters to the `live table filter` prompt in the terminal to refine the incoming packets. An example filter is as follows:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
live table filter: [SrcK8S_Zone:us-west-1b] press enter to match multiple regular expressions at once
|
|
----
|
|
. Use the *PageUp* and *PageDown* keys to toggle between *None*, *Resource*, *Zone*, *Host*, *Owner* and *all of the above*.
|
|
. To stop capturing, press kbd:[Ctrl+C].
|
|
. View the captured data, which is written to a single file in an `./output/pcap` directory located in the same path that was used to install the CLI:
|
|
.. The `./output/pcap/<capture_date_time>.pcap` file can be opened with Wireshark. |