// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc

:_mod-docs-content-type: REFERENCE
[id="virt-example-bond-nncp_{context}"]
= Example: Bond interface node network configuration policy

[role="_abstract"]
You can create a bond interface on nodes in the cluster by applying a `NodeNetworkConfigurationPolicy` manifest to the cluster.

[NOTE]
====
{VirtProductName} only supports the following bond modes:

* `active-backup`
* `balance-xor`
* `802.3ad`

Other bond modes are not supported.
====

The `balance-xor` and `802.3ad` bond modes require switch configuration to establish an "EtherChannel" or similar port grouping. Those two modes also require additional load-balancing configuration, depending on the source and destination of traffic being passed through the interface. The `active-backup` bond mode does not require any switch configuration. Other bond modes are not supported.

The following YAML file is an example of a manifest for a bond interface.
It includes samples values that you must replace with your own information.

[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
  name: bond0-eth1-eth2-policy
spec:
  nodeSelector:
    kubernetes.io/hostname: <node01>
  desiredState:
    interfaces:
    - name: bond0
      description: Bond with ports eth1 and eth2
      type: bond
      state: up
      ipv4:
        dhcp: true
        enabled: true
      link-aggregation:
        mode: active-backup
        options:
          miimon: '140'
        port:
        - eth1
        - eth2
      mtu: 1450
----

* `metadata.name` defines the name of the policy.
* `spec.nodeSelector` defines  the nodes in the cluster the networking policy is applied to. If not defined, the default is all nodes.
* `spec.nodeSelector.kubernetes.io/hostname` uses a hostname node selector.
* `spec.desiredState.interfaces.name` defines the name of the interface.
* `spec.desiredState.interfaces.description` is optional and defines a human-readable description of the interface.
* `spec.desiredState.interfaces.type` defines the type of interface. This example creates a bond.
* `spec.desiredState.interfaces.state` defines the requested state for the interface after creation.
* `spec.desiredState.interfaces.ipv4.dhcp` is optional. If you do not use `dhcp`, you can either set a static IP or leave the interface without an IP address.
* `spec.desiredState.interfaces.ipv4.enabled` defines that `ipv4` is enabled in this example.
* `spec.desiredState.interfaces.link-aggregation.mode` defines the driver mode for the bond. This example uses `active backup`.
* `spec.desiredState.interfaces.link-aggregation.options.miimon` is optional and defines that miimon is used to inspect the bond link every 140ms.
* `spec.desiredState.interfaces.link-aggregation.port` defines the subordinate node NICs in the bond.
* `spec.desiredState.interfaces.mtu` is optional and defines the maximum transmission unit (MTU) for the bond. If not specified, this value is set to `1500` by default.
