Red Hat Training

A Red Hat training course is available for RHEL 8

46.3. nmstatectl を使用して全トラフィックを受け入れるようにネットワークデバイスを永続的に設定する手順

nmstatectl ユーティリティーを使用して、Nmstate API を介して、MAC アドレスに関係なくすべてのトラフィックを受け入れるようにデバイスを設定します。Nmstate API は、設定を行った後、結果が設定ファイルと一致することを確認します。何らかの障害が発生した場合には、nmstatectl は自動的に変更をロールバックし、システムが不正な状態のままにならないようにします。

前提条件

  • nmstate パッケージがインストールされている。
  • デバイスの設定に使用した enp1s0.yml ファイルが利用できます。

手順

  1. enp1s0 接続の既存の enp1s0.yml ファイルを編集し、以下の内容を追加します。

    ---
    interfaces:
      - name: enp1s0
        type: ethernet
        state: up
        accept -all-mac-address: true

    これらの設定では、enp1s0 デバイスがすべてのトラフィックを受け入れるように設定します。

  2. ネットワーク設定を適用します。

    # nmstatectl apply ~/enp1s0.yml

検証

  • 802-3-ethernet.accept-all-mac-addresses モードが有効になっていることを確認します。

    # nmstatectl show enp1s0
    interfaces:
      - name: enp1s0
        type: ethernet
        state: up
        accept-all-mac-addresses:     true
    ...

    この 802-3-ethernet.accept-all-mac-addresses: true は、モードが有効であることを示しています。

関連情報

  • nmstatectl(8) の man ページ
  • /usr/share/doc/nmstate/examples/ directory