CentOS 6 网卡 bonding

关于绑定技术,前面的文章已经介绍,就不细说了,直接上配置。

前文参考:http://www.quwenqing.com/read-91.html

# cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

NM_CONTROLLED=yes

ONBOOT=yes

TYPE=Ethernet

BOOTPROTO=none

IPADDR=10.10.10.1

PREFIX=24

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System bond0"

BONDING_MASTER="yes"

BONDING_SLAVE0="eth1"

BONDING_SLAVE1="eth2"

USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-eth1 

DEVICE=eth1

NM_CONTROLLED=yes

ONBOOT=yes

HWADDR=XX:XX:XX:XX:XX:01

TYPE=Ethernet

BOOTPROTO=none

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth1"

MASTER=bond0

SLAVE=yes

USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

NM_CONTROLLED=yes

ONBOOT=yes

HWADDR=XX:XX:XX:XX:XX:02

TYPE=Ethernet

BOOTPROTO=none

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth2"

MASTER=bond0

SLAVE=yes

USERCTL=no

#cat /etc/modprobe.d/bonding.conf 

alias bond0 bonding

options bonding mode=6 miimon=100    #注:采用的模式6(adaptive load balancing),不依赖交换设备配置

重启网络或者系统

#ifconfig

bond0     Link encap:Ethernet  HWaddr  XX:XX:XX:XX:XX:01   #注:eth1的mac  

          inet addr:10.10.10.1  Bcast:10.10.10.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

          RX packets:628946897 errors:0 dropped:2341 overruns:0 frame:0

          TX packets:235715639 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:787658065089 (733.5 GiB)  TX bytes:17489519087 (16.2 GiB)

eth1      Link encap:Ethernet  HWaddr  XX:XX:XX:XX:XX:01   

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:599399501 errors:0 dropped:2341 overruns:0 frame:0

          TX packets:185380646 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:749875925242 (698.3 GiB)  TX bytes:13812631980 (12.8 GiB)

          Interrupt:48 Memory:d8000000-d8012800 

eth2      Link encap:Ethernet  HWaddr  XX:XX:XX:XX:XX:02   

          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1

          RX packets:29547396 errors:0 dropped:0 overruns:0 frame:0

          TX packets:50334993 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:37782139847 (35.1 GiB)  TX bytes:3676887107 (3.4 GiB)

          Interrupt:32 Memory:da000000-da012800 

 # cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: adaptive load balancing

Primary Slave: None

Currently Active Slave: eth1

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: XX:XX:XX:XX:XX:01

Slave queue ID: 0

Slave Interface: eth2

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: XX:XX:XX:XX:XX:02

Slave queue ID: 0

 交换设备

dis mac 

Reading entire MAC table. Please wait...

MAC ADDR        VLAN ID    STATE            PORT INDEX             AGING TIME

 XXXX-XXXX-XX01   10       Learned          GigabitEthernet0/1    AGING

 XXXX-XXXX-XX02   10       Learned          GigabitEthernet0/2    AGING 

 dis arp            

IP Address        MAC Address     VLAN ID  Port Name            Aging

10.10.10.1      XXXX-XXXX-XX01   10     GigabitEthernet0/1  20 

标签: CentOS bonding
评论: 0 | 引用: 0 | 阅读: 7517