在CentOS上做双网卡绑定:
1.确定网卡和配置文件
修改配置文件:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
#广播域
BROADCAST=10.10.10.255
#网卡物理地址
IPADDR=10.10.10.221
#子网掩码
NETMASK=255.255.255.0
NETWORK=10.10.10.0
ONBOOT=yes
#网关地址
GATEWAY=10.10.10.1
TYPE=Ethernet
2. 在模块文件中添加如下标红的内容:
vi /etc/modprobe.conf
alias eth0 bnx2
alias eth1 bnx2
alias scsi_hostadapter megaraid_sas
alias scsi_hostadapter1 usb-storage
alias bond0 bonding
options bond0 miimon=100 mode=0
3.在启动文件中加入如下标红内容:
cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script. will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style. init stuff.
touch /var/lock/subsys/local
ifenslave bond0 eth0 eth1
4.重启网络服务
/etc/init.d/network restart
Shutting down interface bond0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface bond0: [ OK ]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23141985/viewspace-701726/ ,如需转载,请注明出处,否则将追究法律责任。