1. 编辑文件:
#vi /etc/modprobe.conf
alias eth0 tg3
alias eth1 tg3
alias eth2 e1000 注:e1000为服务器单加的网卡
添加:
alias bond0 bonding
options bond0 miimon=100 mode=1
(0 表示load blance ;1 表示热备)
#vi /etc/modprobe.conf
alias eth0 tg3
alias eth1 tg3
alias eth2 e1000 注:e1000为服务器单加的网卡
添加:
alias bond0 bonding
options bond0 miimon=100 mode=1
(0 表示load blance ;1 表示热备)
2. 创建bond0起动配置文件:
cd /etc/sysconfig/network-scripts/
vi ifcfg-bond0
内容如下:
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.36
NETMASK=255.255.255.0
USERCTL=no
内容如下:
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.36
NETMASK=255.255.255.0
USERCTL=no
3. 编辑ifcfg-eth0 , ifcfg-eth1两个网卡配置文件,内容如下:
#vi ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=XXXXXXXXXXXXXX
#vi ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=XXXXXXXXXXXXXX
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=XXXXXXXXXXXXXX
4. 编辑启动文件
#vi /etc/rc.d/rc.local
在最后加入:
ifenslave bond0 eth0 eth1
(如果改变网卡的顺序及eth0等对应的物理网卡,一定要在做bond0前来做,不然改不过来,改变网卡顺序的文件为/etc/sysconfig/hwconf)
#vi /etc/rc.d/rc.local
在最后加入:
ifenslave bond0 eth0 eth1
(如果改变网卡的顺序及eth0等对应的物理网卡,一定要在做bond0前来做,不然改不过来,改变网卡顺序的文件为/etc/sysconfig/hwconf)
转载于:https://blog.51cto.com/xfenoo/154892