centos 7 網卡綁定 bond0 開機無法自啓

1.環境
CentOS Linux release 7.2.1511 (Core)
linux core  3.10.0-327.el7.x86_64

2.問題描述

配置網卡綁定時,bond 網卡配置文件已經配置完畢
同時,/etc/modprobe.conf 下,也已完成配置。
 
 使用 modprobe bonding 能夠加載相應模塊
 重啓網絡服務後,bond0 能夠正確運行。
 
 那麼問題來了
    重啓後,模塊就沒了,只能手動再進行加載
    
    
3.配置文件(隨便複製了個)
/etc/sysconfig/network-scripts

# vi ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.122.12
NETMASK=255.255.255.0
GATEWAY=192.168.122.1
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes


# vi ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

# vi ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding
options bond0 mode=active-backup miimon=100 downdelay=200 updelay=200


# modprobe bonding
# service network restart

    
4.解決方案
貌似 CentOS 6.x 以後的版本已經不使用  /etc/modprobe.conf 這個配置文件了
所以 只需要把 *.conf 文件 放到 /etc/modprobe.d  目錄下就行了
囧。。。。。。


5.參考文檔
http://www.tokiwinter.com/configuring-interface-bonding-on-centosrheloel-6-x/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章