双网卡绑定操作

/etc/sysconfig/network-scripts  ifcfg-bond0 新建
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
NAME=bond0
BONDING_MASTER=yes
IPADDR=172.16.0.2
NETMASK=255.255.255.0
GATEWAY=172.16.0.1
BROADCAST=172.16.0.254

/etc/sysconfig/network-scripts  ifcfg-em1 修改
DEVICE=em1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
NAME=em1
MASTER=bond0
SLAVE=yes

/etc/sysconfig/network-scripts ifcfg-em2 修改
DEVICE=em2
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
NAME=em2
MASTER=bond0
SLAVE=yes


vi  /etc/modprobe.conf 新建
alias bond0 bonding
options bond miimon=100 mode=1

vi /etc/rc.d/rc.local 增加
ifenslave bond0 em1 em2

你可能感兴趣的:(linux,shell)