centos 多网卡绑定实验

1.)#vi/etc/modprobe.conf

添加

aliasbond0bonding

optionsbondingmax_bonds=1


2.)#viifcfg-bond0
加入如下内容
#IntelCorporation82545EMGigabitEthernetController(copper)
DEVICE=bond0
BOOTPROTO=none
broADCAST=192.168.100.255
IPADDR=192.168.100.12
NETMASK=255.255.255.0
NETWORK=192.168.100.0
ONBOOT=yes

BONDING_OPTS="mode=1miimon=100primary=eth0"

3.)修改ifcfg-eth0ifcfg-eth1
#viifcfg-eth0
修改为如下内容
#IntelCorporation82545EMGigabitEthernetController(copper)
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
#cpifcfg-eth0ifcfg-eth1
#viifcfg-eth1
修改为如下内容
#IntelCorporation82545EMGigabitEthernetController(copper)
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

4.)重启服务
#servicenetworkrestart
查看一下

[root@localhost~]#ifconfig-a

bond0Linkencap:EthernetHWaddr00:0C:29:27:C3:F3

inetaddr:192.168.100.141Bcast:192.168.100.255Mask:255.255.255.0

inet6addr:fe80::20c:29ff:fe27:c3f3/64Scope:Link

UPbroADCASTRUNNINGMASTERMULTICASTMTU:1500Metric:1

RXpackets:9024errors:0dropped:0overruns:0frame:0

TXpackets:1518errors:0dropped:0overruns:0carrier:0

collisions:0txqueuelen:0

RXbytes:929203(907.4KiB)TXbytes:249989(244.1KiB)

eth0Linkencap:EthernetHWaddr00:0C:29:27:C3:F3

UPbroADCASTRUNNINGSLAVEMULTICASTMTU:1500Metric:1

RXpackets:3572errors:0dropped:0overruns:0frame:0

TXpackets:1429errors:0dropped:0overruns:0carrier:0

collisions:0txqueuelen:1000

RXbytes:376305(367.4KiB)TXbytes:240448(234.8KiB)

eth1Linkencap:EthernetHWaddr00:0C:29:27:C3:F3

RXpackets:5457errors:0dropped:0overruns:0frame:0

TXpackets:102errors:0dropped:0overruns:0carrier:0

RXbytes:553198(540.2KiB)TXbytes:11527(11.2KiB)

或者

1.新建ifcfg-bond0

[root@dexnetwork-scripts]#cd/etc/sysconfig/network-scripts/ [root@dexnetwork-scripts]#cpifcfg-eth0ifcfg-bond0 [root@dexnetwork-scripts]#viifcfg-bond0 加入如下内容 #IntelCorporation82545EMGigabitEthernetController(copper) DEVICE=bond0 BOOTPROTO=none broADCAST=192.168.100.255 IPADDR=192.168.100.12 NETMASK=255.255.255.0 NETWORK=192.168.100.0 ONBOOT=yes 2.修改ifcfg-eth0ifcfg-eth1 [root@dexnetwork-scripts]#viifcfg-eth0 修改为如下内容 #IntelCorporation82545EMGigabitEthernetController(copper) DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes [root@dexnetwork-scripts]#cpifcfg-eth0ifcfg-eth1 [root@dexnetwork-scripts]#viifcfg-eth1 修改为如下内容 #IntelCorporation82545EMGigabitEthernetController(copper) DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes 3.修改/etc/modprobe.conf文件 [root@dexnetwork-scripts]#vi/etc/modprobe.conf 加入如下两行 aliasbond0bonding optionsbond0miimon=100mode=1 mode=0表示两块网卡同时工作,提供负载均衡 mode=1表示提供冗余功能(主备模式)

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native