Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions modules/virt-creating-linux-bridge-nad-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The NAD and the VM must be in the same namespace.

[WARNING]
====
Configuring IP address management (IPAM) in a network attachment definition for virtual machines is not supported.
Configuring IP address management (IPAM) in a network attachment definition for VMs is not supported.
====

.Prerequisites
Expand Down Expand Up @@ -40,8 +40,8 @@ spec:
"bridge": "br1", <5>
"macspoofchk": false, <6>
"vlan": 100, <7>
"disableContainerInterface": true,
"preserveDefaultVlan": false <8>
"disableContainerInterface": true, <8>
"preserveDefaultVlan": false <9>
}
----
<1> The name for the `NetworkAttachmentDefinition` object.
Expand All @@ -51,13 +51,36 @@ spec:
<5> The name of the Linux bridge configured on the node. The name should match the interface bridge name defined in the `NodeNetworkConfigurationPolicy` manifest.
<6> Optional: A flag to enable the MAC spoof check. When set to `true`, you cannot change the MAC address of the pod or guest interface. This attribute allows only a single MAC address to exit the pod, which provides security against a MAC spoofing attack.
<7> Optional: The VLAN tag. No additional VLAN configuration is required on the node network configuration policy.
<8> Optional: Indicates whether the VM connects to the bridge through the default VLAN. The default value is `true`.
<8> Optional: When set to `true`, the Bridge CNI plug-in skips creating a standard container virtual ethernet (`veth`) interface inside the pod's network namespace. This enables the virtualization networking backend to attach the layer-2 interface directly to the guest VM instead of a standard container.
<9> Optional: Indicates whether the VM connects to the bridge through the default VLAN. The default value is `true`.
+
[NOTE]
====
A Linux bridge network attachment definition is the most efficient method for connecting a virtual machine to a VLAN.
====

. Optional: If you want to connect a VM to the native network, configure the Linux bridge `NetworkAttachmentDefinition` manifest without specifying any VLAN:
+
[source,yaml]
----
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: bridge-network
annotations:
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1
spec:
config: |
{
"cniVersion": "0.3.1",
"name": "bridge-network",
"type": "bridge",
"bridge": "br1",
"macspoofchk": false,
"disableContainerInterface": true
}
----

. Create the network attachment definition:
+
[source,terminal]
Expand Down
23 changes: 22 additions & 1 deletion modules/virt-creating-linux-bridge-nad-web.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,25 @@ The network attachment definition must be in the same namespace as the pod or vi
. Enter the name of the bridge in the *Bridge Name* field.
. Optional: If the resource has VLAN IDs configured, enter the ID numbers in the *VLAN Tag Number* field.
. Optional: Select *MAC Spoof Check* to enable MAC spoof filtering. This feature provides security against a MAC spoofing attack by allowing only a single MAC address to exit the pod.
. Click *Create*.
. Optional: In the *YAML* tab, add the `spec.config.disableContainerInterface` field. When set to `true`, the Bridge CNI plug-in skips creating a standard container virtual ethernet (`veth`) interface inside the pod's network namespace. This enables the virtualization networking backend to attach the layer-2 interface directly to the guest VM instead of a standard container.
+
Example YAML:
+
[source,yaml]
----
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: bridge-network
annotations:
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1
spec:
config: |
{
# ...
"disableContainerInterface": true,
# ...
}
----

. Click *Create*.