9.7. Connecting a virtual machine to a Linux bridge network


By default, OpenShift Virtualization is installed with a single, internal pod network. You can connect a virtual machine (VM) to the physical network by using a Linux bridge.

To create a Linux bridge network and attach a VM to the network, perform the following steps:

  1. Prepare the node network by creating a Linux bridge node network configuration policy (NNCP).
  2. Define the secondary Linux bridge network by creating a network attachment definition (NAD).
  3. Attach the VM to the Linux bridge network.
참고

OpenShift Virtualization does not support Linux bridge bonding modes 0, 5, and 6. For more information, see "Additional resources".

9.7.1. Create a Linux bridge node network configuration policy

You can configure a Linux bridge network for live migration or external access to virtual machines (VMs) by creating a NodeNetworkConfigurationPolicy (NNCP) manifest.

Prerequisites

  • You have installed the Kubernetes NMState Operator.

Procedure

  1. Configure the NNCP manifest. This example includes sample values that you must replace with your own information.

    apiVersion: nmstate.io/v1
    kind: NodeNetworkConfigurationPolicy
    metadata:
      name: br1-eth1-policy
    spec:
      desiredState:
        interfaces:
          - name: br1
            description: Linux bridge with eth1 as a port
            type: linux-bridge
            state: up
            ipv4:
              enabled: false
            bridge:
              options:
                stp:
                  enabled: false
              port:
                - name: eth1
    • metadata.name: Defines the name of the node network configuration policy.
    • spec.desiredState.interfaces.name: Defines the name of the new Linux bridge.
    • spec.desiredState.interfaces.description: Optional field that can be used to define a human-readable description for the bridge.
    • spec.desiredState.interfaces.type: Defines the interface type. In this example, the type is a Linux bridge.
    • spec.desiredState.interfaces.state: Defines the requested state for the interface after creation.
    • spec.desiredState.interfaces.ipv4.enabled: Defines whether the ipv4 protocol is active. Setting this to false disables IPv4 addressing on this bridge.
    • spec.desiredState.interfaces.bridge.options.stp.enabled: Defines whether Spanning Tree Protocol (STP) is active. Setting this to false disables STP on this bridge.
    • spec.desiredState.interfaces.bridge.port.name: Defines the node NIC that the bridge is attached to.

      참고

      To create the NNCP manifest for a Linux bridge using Open Systems Adapter (OSA) with IBM Z®, you must disable VLAN filtering by the setting the rx-vlan-filter to false in the NodeNetworkConfigurationPolicy manifest.

      Alternatively, if you have SSH access to the node, you can disable VLAN filtering by running the following command:

      $ sudo ethtool -K <osa-interface-name> rx-vlan-filter off
  2. Create the NNCP manifest:

    $ oc apply -f linux-bridge-nncp.yaml
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동