5.4. BGP のデータプレーンネットワークの作成


データプレーンネットワークを作成するには、NetConfig カスタムリソース (CR) を定義し、データプレーンネットワークのすべてのサブネットを指定します。データプレーン用に少なくとも 1 つのコントロールプレーンネットワークを定義する必要があります。また、VLAN ネットワークを定義して、InternalAPIStorageExternal などのコンポーザブルネットワークのネットワーク分離を作成することもできます。各ネットワーク定義には IP アドレスの割り当てを含める必要があります。

ヒント

NetConfig CRD 定義と仕様スキーマを表示するには、次のコマンドを使用します。

$ oc describe crd netconfig

$ oc explain netconfig.spec

手順

  1. ワークステーションに netconfig_bgp.yaml という名前のファイルを作成します。
  2. NetConfig CR を作成するには、netconfig_bgp.yaml に次の設定を追加します。

    apiVersion: network.openstack.org/v1beta1
    kind: NetConfig
    metadata:
      name: bgp-netconfig
      namespace: openstack
  3. netconfig_bgp.yaml ファイルで、各データプレーンネットワークのトポロジーを定義します。デフォルトの Red Hat OpenStack Services on OpenShift (RHOSO) ネットワークを使用するには、各ネットワークの仕様を定義する必要があります。デフォルトの RHOSO ネットワークの詳細は、BGP 用のデフォルトの Red Hat OpenStack Services on OpenShift ネットワーク を参照してください。次の例では、データプレーン用の分離ネットワークを作成します。

    apiVersion: network.openstack.org/v1beta1
    kind: NetConfig
    metadata:
      name: bgp-netconfig
      namespace: openstack
    spec:
      networks:
      - name: ctlplane 
    1
    
        dnsDomain: ctlplane.example.com
        serviceNetwork: ctlplane
        mtu: 1500
        subnets: 
    2
    
        - name: subnet1 
    3
    
          allocationRanges: 
    4
    
          - end: 192.168.122.120
            start: 192.168.122.100
          - end: 192.168.122.200
            start: 192.168.122.150
          cidr: 192.168.122.0/24
          gateway: 192.168.122.1
        - name: subnet2
          allocationRanges:
          - end: 192.168.123.120
            start: 192.168.123.100
          - end: 192.168.123.200
            start: 192.168.123.150
          cidr: 192.168.123.0/24
          gateway: 192.168.123.1
        - name: subnet3
          allocationRanges:
          - end: 192.168.124.120
            start: 192.168.124.100
          - end: 192.168.124.200
            start: 192.168.124.150
          cidr: 192.168.124.0/24
          gateway: 192.168.124.1
      - name: internalapi
        dnsDomain: internalapi.example.com
        serviceNetwork: internalapi
        mtu: 1500
        subnets:
        - name: subnet1
          allocationRanges:
          - end: 172.17.0.250
            start: 172.17.0.100
          cidr: 172.17.0.0/24
        vlan: 20 
    5
    
      - name: external
        dnsDomain: external.example.com
        mtu: 1500
        subnets:
        - name: subnet1
          allocationRanges:
          - end: 192.168.32.250
            start: 192.168.32.130
          cidr: 192.168.32.0/20
        vlan: 99
      - name: storage
        dnsDomain: storage.example.com
        mtu: 1500
        subnets:
        - name: subnet1
          allocationRanges:
          - end: 172.18.0.250
            start: 172.18.0.100
        cidr: 172.18.0.0/24
        vlan: 21
      - name: tenant
        dnsDomain: tenant.example.com
        mtu: 1500
        subnets:
        - name: subnet1
          allocationRanges:
          - end: 172.19.0.250
            start: 172.19.0.100
          cidr: 172.19.0.0/24
        vlan: 22
    1
    ネットワークの名前 (例: CtlPlane)。
    2
    IPv4 サブネット仕様。
    3
    サブネットの名前 (例: subnet1)。
    4
    NetConfigallocationRangeallocationRange が、MetalLB IPAddressPool の範囲および IP アドレスプール範囲と重複しないようにしてください。
    5
    ネットワーク VLAN。デフォルトの RHOSO ネットワークの詳細は、BGP 用のデフォルトの Red Hat OpenStack Services on OpenShift ネットワーク を参照してください。
  4. netconfig_bgp.yaml ファイルで、各ゾーン内で接続を確立するネットワークインターフェイスを定義します。次の例では、eth2 用の bgpnet0 と `eth3 用の bgpnet1 の 2 つのネットワークインターフェイスを定義し、各ゾーンにサブネットを設定します。

      - name: bgpnet0 
    1
    
        dnsDomain: bgpnet0.example.com
        serviceNetwork: bgpnet0
        mtu: 1500
        subnets:
        - name: subnet0
          allocationRanges:
          - end: 100.64.0.36
            start: 100.64.0.1
          cidr: 100.64.0.0/24
          gateway: 100.64.0.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.64.0.1
        - name: subnet1
          allocationRanges:
          - end: 100.64.1.36
            start: 100.64.1.1
          cidr: 100.64.1.0/24
          gateway: 100.64.1.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.64.1.1
        - name: subnet2
          allocationRanges:
          - end: 100.64.2.36
            start: 100.64.2.1
          cidr: 100.64.2.0/24
          gateway: 100.64.2.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.64.2.1
      - name: bgpnet1 
    2
    
        dnsDomain: bgpnet1.example.com
        serviceNetwork: bgpnet1
        mtu: 1500
        subnets:
        - name: subnet0
          allocationRanges:
          - end: 100.65.0.36
            start: 100.65.0.1
          cidr: 100.65.0.0/24
          gateway: 100.65.0.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.65.0.1
        - name: subnet1
          allocationRanges:
          - end: 100.65.1.36
            start: 100.65.1.1
          cidr: 100.65.1.0/24
          gateway: 100.65.1.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.65.1.1
        - name: subnet2
          allocationRanges:
          - end: 100.65.2.36
            start: 100.65.2.1
          cidr: 100.65.2.0/24
          gateway: 100.65.2.1
          routes:
          - destination: 0.0.0.0/0
            nexthop: 100.65.2.1
    1
    bgpnet0 は、データプレーンノードが BGP ピアと通信するために使用するネットワークです。
    2
    bgpnet1 は、データプレーンノードが BGP ピアと通信するために使用するネットワークです。
  5. netconfig_bgp.yaml ファイルで、各ノードが相互に通信するために使用するループバックインターフェイス bgpmainnet の IP アドレスを設定します。

      - name: bgpmainnet
        dnsDomain: bgpmainnet.example.com
        serviceNetwork: bgpmainnet
        mtu: 1500
        subnets:
        - name: subnet0
          allocationRanges:
          - end: 99.99.0.36
            start: 99.99.0.2
          cidr: 99.99.0.0/24
        - name: subnet1
          allocationRanges:
          - end: 99.99.1.36
            start: 99.99.1.2
          cidr: 99.99.1.0/24
        - name: subnet2
          allocationRanges:
          - end: 99.99.2.36
            start: 99.99.2.2
          cidr: 99.99.2.0/24
  6. `netconfig_bgp.yaml` 定義ファイルを保存します。
  7. データプレーンネットワークを作成します。

    $ oc create -f  netconfig_bgp.yaml -n openstack
  8. BGP 経由で Pod の IP アドレスをアナウンスするために、bgpconfig.yml という名前の BGPConfiguration CR ファイルを作成します。

    apiVersion: network.openstack.org/v1beta1
    kind: BGPConfiguration
    metadata:
      name: bgpconfiguration
      namespace: openstack
    spec: {}
  9. 各 Pod に必要な FRR 設定を作成するために、BGPConfiguration CR を作成します。

    $ oc create -f bgpconfig.yml

検証

  1. データプレーンネットワークが作成されたことを確認します。

    $ oc get netconfig/openstacknetconfig -n openstack

    エラーが表示された場合は、基礎となる network-attach-definition とノードのネットワーク設定ポリシーを確認してください。

    $ oc get network-attachment-definitions -n openstack
    $ oc get nncp
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る