diff --git a/modules/virt-example-enabling-lldp-policy.adoc b/modules/virt-example-enabling-lldp-policy.adoc new file mode 100644 index 0000000000..1915a0be1b --- /dev/null +++ b/modules/virt-example-enabling-lldp-policy.adoc @@ -0,0 +1,28 @@ +// 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`. \ No newline at end of file diff --git a/networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc b/networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc index a6b30bc143..a5780f664a 100644 --- a/networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc +++ b/networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc @@ -110,16 +110,21 @@ include::modules/virt-example-host-vrf.adoc[leveloffset=+2] * xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF] [id="capturing-nic-static-ip_k8s-nmstate-updating-node-network-config"] -== Capturing the static IP of a NIC attached to a bridge +== Example policy configurations that use dynamic matching and templating + +The following example configuration snippets show node network policies that use dynamic matching and templating. ifdef::openshift-enterprise[] -:FeatureName: Capturing the static IP of a NIC +:FeatureName: Applying node network configuration policies that use dynamic matching and templating include::snippets/technology-preview.adoc[leveloffset=+2] endif::[] // Example: Linux bridge interface node network configuration policy to inherit static IP address from the NIC attached to the bridge include::modules/virt-example-inherit-static-ip-from-nic.adoc[leveloffset=+2] +//Example: LLDP policy +include::modules/virt-example-enabling-lldp-policy.adoc[leveloffset=+2] + [role="_additional-resources"] .Additional resources * link:https://nmstate.io/nmpolicy/user-guide/102-policy-syntax.html[The NMPolicy project - Policy syntax]