双网卡教程
1. 停止NetworkManager
[root@db01 ~]# service NetworkManager stop
[root@db01 ~]# chkconfig NetworkManager off
2. 手工写绑定的配置 ifcfg-bond0
[root@db01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
————————————————————添加内容————————————————————
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.6.216
PREFIX=24
GATEWAY=192.168.6.1
USERCTL=no
[root@db01 ~]# mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0-bak #备份本文件
[root@db01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
————————————————————添加内容————————————————————
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
slave=yes
[root@db01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
————————————————————添加内容————————————————————
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
slave=yes
[root@db01 ~]# vi /etc/modprobe.d/bonding.conf
————————————————————添加内容————————————————————
alias bond0 bonding
options bond0 miimon=100 mode=1
3. 开机生效
[root@db01 ~]# vi /etc/rc.d/rc.local
————————————添加内容——————————
ifenslave bond0 eth0 eth1
4. 重启服务生效
[root@db01 ~]# service network restart-----远程连接断开(真实机器的话最好重启)
[root@db01 ~]# ifenslave bond0 eth0 eth1
5. 状态检查
[root@db01 ~]# ifconfig -a
[root@db01 ~]# cat /proc/net/bonding/bond0
6. 双网卡解绑
[root@db01 ~]# rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0
[root@db01 ~]# rm -rf /etc/modprobe.d/bonding.conf
[root@db01 ~]# rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0
[root@db01 ~]# rm -rf /etc/sysconfig/network-scripts/ifcfg-eth1
[root@db01 ~]# rmmod bonding
[root@db01 ~]# service network restart --远程连接断开