Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

如何在 Linux 中建立 NIC 通道搭接

Summary: 本文提供如何在 RHEL 5.x\6.x 中建立 NIC 通道繫結的資訊。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

 

Cause

 

Resolution

環境:RHEL 5.x/6.x

以下範例將建立使用 eth0、eth1 和循環制原則的 NIC 通道搭接,以實現容錯和負載平衡:

  1. 以 root 身分建立 Bond0 組態檔案:# vi /etc/sysconfig/network-scripts/ifcfg-bond0
     
  2. 將以下行新增至 Bond0 設定檔:

    DEVICE=bond0
    IPADDR=192.168.1.10
    NETWORK=192.168.1.0
    NETMASK=255.255.255.0
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS=“mode=0 miimon=100”
注意:據此更換 IP 位址、網路和網路遮罩設定。
注意:如需搭接選項的詳細說明,請參閱 Red Hat 的部署指南
  1. 開啟 eth0 的組態檔案:

    # vi /etc/sysconfig/network-scripts/ifcfg-eth0

     
  2. 編輯新增「MASTER」和「SLAVE」參數的 eth0 組態檔案:

    DEVICE=eth0
    USERCTL=no
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    BOOTPROTO=none

     
  3. 對 eth1 重複步驟 #3 和 #4。
     
  4. 開啟核心模組組態檔案:

    RHEL5 # vi /etc/modprobe.conf

    RHEL6 # vi /etc/modprobe.d/modprobe.conf
     
注意: RHEL6 上不存在 modprobe.conf 檔案。按照上面列出的步驟,將創建檔。
  1. 將以下行新增至 modprobe.conf 檔案:

    別名 bond0 搭接選項 bond0
    mode=balance-rr miimon=100

     
  2. 載入搭接模組:

    # 莫德探針搭接

     
  3.  重新啟動網路服務:

    # 服務網路重啟

     
  4. 查看 ifconfig 命令的輸出結果,檢查搭接介面是否已成功建立:

    # ifconfig

     
輸出應列出 bond0 作為主伺服器啟動並運行,將 eth0\eth1 作為從站啟動並運行。

  

Article Properties


Affected Product

Servers, PowerEdge, Red Hat Enterprise Linux Version 5, Red Hat Enterprise Linux Version 6

Last Published Date

08 Oct 2021

Version

5

Article Type

Solution