// Module included in the following assemblies:
//
// * networking/multiple_networks/configuring-additional-network.adoc

:_mod-docs-content-type: REFERENCE
[id="nw-multus-bond-cni-object_{context}"]
= Configuration for a Bond CNI secondary network

[role="_abstract"]
The Bond Container Network Interface (Bond CNI) enables the aggregation of multiple network interfaces into a single logical bonded interface within a container, which enhanches network redundancy and fault tolerance. Only SR-IOV Virtual Functions (VFs) are supported for bonding with this plugin.

The following table describes the configuration parameters for the Bond CNI plugin:

.Bond CNI plugin JSON configuration object
[cols=".^2,.^2,.^6",options="header"]
|====
|Field|Type|Description

|`name`
|`string`
|The mandatory, unique identifier assigned to this CNI network attachment definition. It is used by the container runtime to select the correct network configuration and serves as the key for persistent resource state management, such as IP address allocations.

|`cniVersion`
|`string`
|The CNI specification version. A minimum version of `0.3.1` is required.

|`type`
|`string`
|Specifies the name of the CNI plugin to configure: `bond`.

|`miimon`
|`string`
|Specifies the address resolution protocol (ARP) link monitoring frequency in milliseconds. This parameter defines how often the bond interface sends ARP requests to check the availability of its aggregated interfaces.

|`mtu`
|`integer`
|Optional: Specifies the maximum transmission unit (MTU) of the bond. The default is `1500`.

|`failOverMac`
|`integer`
|Optional: Specifies the `failOverMac` setting for the bond. Default is `0`.

|`mode`
|`string`
|Specifies the bonding policy.

|`xmitHashPolicy`
|`string`
|Specifies the transmit hash policy for load balancing across the aggregated interfaces. This parameter defaults to `layer2` and supports the following values: `layer2`, `layer2+3` and `layer3+4`.

|`linksInContainer`
|`boolean`
|Optional: Specifies whether the network interfaces intended for bonding are expected to be created and available directly within the network namespace of the container when the bond starts. If `false` which is the default, the CNI plugin looks for these interfaces on the host system first before attempting to form the bond.

|`links`
|`object`
|Specifies the interfaces to be bonded.

|`ipam`
|`object`
|The configuration object for the IPAM CNI plugin. The plugin manages IP address assignment for the attachment definition.

|====

:FeatureName: xmitHashPolicy
include::snippets/technology-preview.adoc[]

[id="nw-multus-bond-cni-config-example_{context}"]
== Bond CNI plugin configuration example

The following example configures a secondary network named `bond-net1`:

[source,json]
----
{
 "type": "bond",
 "cniVersion": "0.3.1",
 "name": "bond-net1",
 "mode": "active-backup",
 "failOverMac": 1,
 "linksInContainer": true,
 "miimon": "100",
 "mtu": 1500,
 "links": [
       {"name": "net1"},
       {"name": "net2"}
   ],
  "ipam": {
        "type": "host-local",
        "subnet": "10.56.217.0/24",
        "routes": [{
        "dst": "0.0.0.0/0"
        }],
        "gateway": "10.56.217.1"
    }
}
----

The following example configures a secondary network named `bond-tlb-net` with the `xmitHashPolicy` feature enabled:

[source,json]
----
{
 "type": "bond",
 "cniVersion": "0.3.1",
 "name": "bond-tlb-net",
 "mode": "tlb",
 "xmitHashPolicy": "layer2+3",
 "failOverMac": 0,
 "linksInContainer": true,
 "miimon": "100",
 "mtu": 1500,
 "links": [
       {"name": "net1"},
       {"name": "net2"}
   ],
  "ipam": {
        "type": "host-local",
        "subnet": "10.57.218.0/24",
        "routes": [{
        "dst": "0.0.0.0/0"
        }],
        "gateway": "10.57.218.1"
    }
}
----



* `xmitHashPolicy`: This parameter dictates how outgoing network traffic is distributed across the `net1` and `net2` active member interfaces within the bond. The hashing algorithm combines layer 2 information, specifically source and destination MAC addresses, with layer 3 information, which includes source and destination IP addresses.
