環境
- 操作系統 CentOS7.5,禁用 NetworkManager 服務
- 網卡 eth0
- 網卡 eth1
- 綁定網卡 bond0
網卡 eth0 配置
- 修改 /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet BOOTPROTO=none DEVICE=eth0 ONBOOT=yes USERCTL=no SLAVE=yes MASTER=bond0
網卡 eth1 配置
- 修改 /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet BOOTPROTO=none DEVICE=eth1 ONBOOT=yes USERCTL=no SLAVE=yes MASTER=bond0
配置 bond0 綁定模式
- 創建 /etc/modprobe.d/bonding.conf,加入以下內容
alias bond0 bonding options bond0 miimon=100 mode=1
載入 bonding 模塊,重啓 network 服務
modprob bonding
systemctl restart network