GNU/Linux >> Linux の 問題 >  >> Linux

ネットワーク インターフェイスの順序を制御するにはどうすればよいですか?

これを行うためにサポートされている方法は、RHEL 6 および将来において、一貫したネットワーク デバイスの命名です。これにより、すべてのインターフェイスにハードウェアに基づいた意味のある名前が付けられ、システムの存続期間を通じて同じままになります (ハードウェアを変更しない場合、通常は変更した場合でも)。

(RHEL 7 では、別の命名形式が使用されることに注意してください。)

RHEL 6 でこれに切り替えるには、システムを再インストールする必要があります。インストール時には、カーネル コマンド ライン オプション biosdevname=1 を渡す必要があります。 インストール メディアを起動するとき、およびシステムを起動するたびに。


誰かがこれらの情報を役に立つと思うかもしれません:まず第一に、RHEL7 では、インターフェースの命名規則を変更するためにシステムを再インストールする必要はありません。

注:ブート パラメータが必要です:

a) With no parameters or net.ifnames=1 used, the names will use systemd Predictable Network Interface Names
b) With biosdevname=1 used, the names will be managed by udev (technically systemd-udev) using Consistent Network Device Naming
c) With net.ifnames=0 and biosdevname=0 both specified, traditional ("kernel names") ethX names will be used; if udev rules are also added they can rename the interfaces to anything except eth

例:

Edit /etc/default/grub
append selected params eg.
biosdevname=0 net.ifnames=0
grub2-mkconfig -o /boot/grub2/grub.cfg

また、メイン トピックの場合:すべてのインターフェイスの順序を調整する必要がある場合の手順は簡単です:

mv /etc/udev/rules.d/70-persistent-net.rules /root/ 
(New udev rules will be generated at next boot)

Adjust configuration files in
/etc/sysconfig/network-scripts/ifcfg-eth*
[Edit device name, connection name, HWADDR etc.] 

Reboot and then udev will generate rules basing on configuration files - if you did it properely.

RHEL 6 で引き続きサポートされている方法は、udev デバイス ルールを使用する方法です。

自動生成された /etc/udev/rules.d/70-persistent-net.rules があるはずです これにより、一貫した命名が強制されます:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.

# PCI device 0x8086:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:1d:d1:30", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:1d:d1:31", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

そうでない場合は、独自の MAC アドレスで同様の構文を使用して、永続的なデバイス名を強制することができます。


Linux
  1. Linuxmtrコマンドの使用方法

  2. シェルで制御文字(^ c、^ d、^ [、…)を異なる方法で表示する方法は?

  3. CentOS / RHEL 7 :古い ethX スタイルのネットワーク インターフェイス名を有効にする方法

  1. Fedora 19 でデフォルトの ens33 ネットワーク デバイスを古い eth0 に変更するにはどうすればよいですか?

  2. bcache からキャッシュ デバイスを削除するにはどうすればよいですか?

  3. ブロックデバイスをネットワーク経由であるコンピュータから別のコンピュータにブロックデバイスとしてマウントするにはどうすればよいですか?

  1. ネームゲーム:Linuxでのネットワークインターフェイスの命名

  2. Linux:デバイスに使用されているデバイスドライバーを見つける方法は?

  3. Linux で優先ネットワーク インターフェイスを設定する方法