1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-example-enabling-lldp-policy.adoc

28 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
:_mod-docs-content-type: REFERENCE
[id="virt-example-enabling-lldp-policy_{context}"]
= Example: Node network configuration policy to enable LLDP reporting
The following YAML file is an example of a `NodeNetworkConfigurationPolicy` manifest that enables the Link Layer Discovery Protocol (LLDP) listener for all ethernet ports in your {product-title} cluster. Devices on a local area network can use LLDP to advertise their identity, capabilities, and neighbor information.
[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: enable-lldp-ethernets-up # <1>
spec:
capture:
ethernets: interfaces.type=="ethernet"
ethernets-up: capture.ethernets | interfaces.state=="up"
ethernets-lldp: capture.ethernets-up | interfaces.lldp.enabled:=true # <2>
desiredState:
interfaces: "{{ capture.ethernets-lldp.interfaces }}"
# ...
----
<1> Specifies the name of the node network configuration policy.
<2> Specifies that LLDP is enabled for all ethernet ports that have the interface state set to `up`.