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 applies to   This article does not apply to 

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. 编辑 eth0 配置文件,添加“MASTER”和“SLAVE”参数:

    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. 加载绑定模块:

    # modprobe 绑定

     
  3.  重新启动网络服务:

    # service network restart

     
  4. 查看 ifconfig 命令的输出,检查绑定接口是否已成功创建:

    # ifconfig

     
输出应列出 bond0 作为主节点启动并运行,以及 eth0\eth1 作为从属节点启动并运行。

  

Affected Products

Servers, PowerEdge, Red Hat Enterprise Linux Version 5, Red Hat Enterprise Linux Version 6
Article Properties
Article Number: 000177048
Article Type: Solution
Last Modified: 08 Oct 2021
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.
Article Properties
Article Number: 000177048
Article Type: Solution
Last Modified: 08 Oct 2021
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.