1. 程式人生 > >RHEL7網卡命名規則

RHEL7網卡命名規則

location 命名規則 p2s system 信息 replace interface pla all

systemd 和 udev 引入了一種新的網絡設備命名方式:一致網絡設備命名(CONSISTENT NETWORK DEVICE NAMING)。根據固件、拓撲、位置信息來設置固定名字,帶來的好處是命名自動化,名字完全可預測,在硬件壞了以後更換也不會影響設備的命名,這樣可以讓硬件的更換無縫化。帶來的不利是新的設備名稱比傳統的名稱難以閱讀,比如心得名稱是enp5s0。

默認情況下,systemd會按照以下規則為網卡命名:

  • 規則1:將依據Firmware或BIOS提供的設備索引編號為網卡命名。(比如eno1)如果這兩個值不可用或不適用則使用規則2。
  • 規則2:將依據Firmware或BiosPCI-E熱插拔slot索引編號
    為網卡命名。(比如ens1)如果這兩個值不可用或不適用則使用規則3。
  • 規則3:將依據硬件連接器物理位置進行命名。(比如enp2s0)如果適用則應用,否則則采用規則5。
  • 規則4:將根據網卡接口的MAC地址進行命名,(比如enx78e7d1ea46da)默認將不采用該方式,但用戶可配置啟用該方式。
  • 規則5:其他方法都失敗的情況下,最後采用傳統的(不可預測編號)內核命名方式。(比如eth0)
  • 上面的所有命名規則依賴於biosdevname,改程序默認啟用。

The names have two-character prefixes based on the type of interface:

  1. en
    for Ethernet,
  2. wl for wireless LAN (WLAN),
  3. ww for wireless wide area network (WWAN).
The names have the following types:
o<index>
on-board device index number
s<slot>[f<function>][d<dev_id>]
hotplug slot index number. All multi-function PCI devices will carry the [f<function
>]
number in the device name, including the function 0 device.
x<MAC>
MAC address
[P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
PCI geographical location. In PCI geographical location, the [P<domain>] number is only mentioned if the value is not 0. For example: ID_NET_NAME_PATH=P1enp5s0
[P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
USB port number chain. For USB devices, the full chain of port numbers of hubs is composed. If the name gets longer than the maximum number of 15 characters, the name is not exported. If there are multiple USB devices in the chain, the default values for USB configuration descriptors (c1) and USB interface descriptors (i0) are suppressed.

RHEL7網卡命名規則