網卡綁定將多張物理網卡聚合為一張邏輯網卡,可提升頻寬或提供熱備份。本文以 CentOS 為例,說明 bonding 模組載入與網路腳本配置全過程。

bonding 核心模組支援。balance-alb 提升吞吐量,active-backup 熱備份。vi /etc/modprobe.conf
alias bond0 bonding
options bond0 mode=balance-alb miimon=100 use_carrier=0
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.110.2
NETWORK=192.168.110.0
NETMASK=255.255.255.0
GATEWAY=192.168.110.1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
service network restart
完成後可用 cat /proc/net/bonding/bond0 驗證綁定狀態。