Linux下雙網卡綁定

1.關閉NetworkManager服務
#service NetworkManager stop
#chkconfig NetworkManager off

2.配置網卡
新建 #vim /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none/static都可以
IPADDR=192.168.
NETMASK=255.255.255.0
GATEWAY=192.168.
USERCTL=no
DNS1= 可不寫

編輯 #vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=no

編輯 #vim /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
NBOOT=yes
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=no

3.修改modprobe相關設定文件,並加載bonding模塊:
新建 #vim /etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 miimon=100 mode=1

加載模塊(重啓系統後就不用手動再加載了)

modprobe bonding

確認模塊是否加載成功:

lsmod |grep bonding

bonding 100065 0

# service network restart
# cat /proc/net/bonding/bond0

注意重啓虛擬機或關閉虛擬機再打開

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章