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

:_mod-docs-content-type: REFERENCE
[id="virt-example-nmstate-multiple-interfaces_{context}"]
= Example: Multiple interfaces in the same node network configuration policy

[role="_abstract"]
You can create multiple interfaces in the same node network configuration policy. These interfaces can reference each other, allowing you to build and deploy a network configuration by using a single policy manifest.

[IMPORTANT]
====
If multiple interfaces use the same default configuration, a single Network Manager connection profile activates on multiple interfaces simultaneously and this causes connections to have the same universally unique identifier (UUID). To avoid this issue, ensure that each interface has a specific configuration that is different from the default configuration.
====

The following example YAML file creates a bond that is named `bond10` across two NICs and VLAN that is named `bond10.103` that connects to the bond.

[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
  name: bond-vlan
spec:
  nodeSelector:
    kubernetes.io/hostname: <node01>
  desiredState:
    interfaces:
    - name: bond10
      description: Bonding eth2 and eth3
      type: bond
      state: up
      link-aggregation:
        mode: balance-xor
        options:
          miimon: '140'
        port:
        - eth2
        - eth3
    - name: bond10.103
      description: vlan using bond10
      type: vlan
      state: up
      vlan:
         base-iface: bond10
         id: 103
      ipv4:
        dhcp: true
        enabled: true
----

* `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.
* `spec.desiredState.interfaces.state` defines the requested state for the interface after creation.
* `spec.desiredState.interfaces.link-aggregation.mode` defines the driver mode for the bond.
* `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.vlan.base-iface` defines the node NIC to which the VLAN is attached.
* `spec.desiredState.interfaces.vlan.id` defines the VLAN tag.
* `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.
