Skip to content

Commit 2db1267

Browse files
authored
Merge pull request #92544 from dfitzmau/OSDOCS-14170
OSDOCS-14170: Created doc for enabled port isolation Linux bridge CNI…
2 parents 0650fda + e51eed6 commit 2db1267

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/vm_networking/virt-connecting-vm-to-linux-bridge.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-linux-bridge-nad-port-isolation.adoc_{context}"]
7+
= Enabling port isolation for a Linux bridge NAD
8+
9+
You can enable port isolation for a Linux bridge network attachment definition (NAD) so that virtual machines (VMs) or pods that run on the same virtual LAN (VLAN) can operate in isolation from one another. The Linux bridge NAD creates a virtual bridge, or _virtual switch_, between network interfaces and the physical network.
10+
11+
Isolating ports in this way can provide enhanced security for VM workloads that run on the same node.
12+
13+
.Prerequisites
14+
15+
* For VMs, you configured either a static or dynamic IP address for each VM. See "Configuring IP addresses for virtual machines".
16+
* You created a Linux bridge NAD by using either the web console or the command-line interface.
17+
18+
.Procedure
19+
20+
. Edit the Linux bridge NAD by setting `portIsolation` to `true`:
21+
+
22+
[source,yaml]
23+
----
24+
apiVersion: "k8s.cni.cncf.io/v1"
25+
kind: NetworkAttachmentDefinition
26+
metadata:
27+
name: bridge-network
28+
annotations:
29+
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1
30+
spec:
31+
config: |
32+
{
33+
"cniVersion": "0.3.1",
34+
"name": "bridge-network", <1>
35+
"type": "bridge", <2>
36+
"bridge": "br1", <3>
37+
"preserveDefaultVlan": false,
38+
"vlan": 100,
39+
"disableContainerInterface": false,
40+
"portIsolation": true <4>
41+
}
42+
# ...
43+
----
44+
<1> The name for the configuration. The name must match the the value in the `metadata.name` of the NAD.
45+
<2> The actual name of the Container Network Interface (CNI) plugin that provides the network for this network attachment definition. Do not change this field unless you want to use a different CNI.
46+
<3> The name of the Linux bridge that is configured on the node. The name must match the interface bridge name defined in the NodeNetworkConfigurationPolicy manifest.
47+
<4> Enables or disables port isolation on the virtual bridge. Default value is `false`. When set to `true`, each VM or pod is assigned to an isolated port. The virtual bridge prevents traffic from one isolated port from reaching another isolated port.
48+
49+
. Apply the configuration:
50+
+
51+
[source,terminal]
52+
----
53+
$ oc apply -f example-vm.yaml
54+
----
55+
56+
. Optional: If you edited a running virtual machine, you must restart it for the changes to take effect.

virt/vm_networking/virt-connecting-vm-to-linux-bridge.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ include::modules/virt-creating-linux-bridge-nncp.adoc[leveloffset=+1]
2626

2727
You can create a Linux bridge network attachment definition (NAD) by using the {product-title} web console or command line.
2828

29+
// Creating a Linux bridge NAD by using the web console
2930
include::modules/virt-creating-linux-bridge-nad-web.adoc[leveloffset=+2]
3031

32+
// Creating a Linux bridge NAD by using the command line
3133
include::modules/virt-creating-linux-bridge-nad-cli.adoc[leveloffset=+2]
3234

35+
// Enabling port isolation for a Linux bridge NAD
36+
include::modules/virt-linux-bridge-nad-port-isolation.adoc[leveloffset=+2]
37+
38+
[role="_additional-resources"]
39+
.Additional resources
40+
* xref:../../virt/vm_networking/virt-configuring-viewing-ips-for-vms.adoc#configuring-ips_virt-configuring-viewing-ips-for-vms[Configuring IP addresses for virtual machines]
41+
3342
[id="configuring-vm-network-interface"]
3443
== Configuring a VM network interface
3544

0 commit comments

Comments
 (0)