码迷,mamicode.com
首页 > 其他好文 > 详细

RHEL6.X网卡绑定操作

时间:2017-08-19 23:42:24      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:rhel6   bonding   bond0   

1.创建ifcfg-bond0接口文件

# vi ifcfg-bond0

DEVICE=bond0

BOOTPROTO=static

ONBOOT=yes

NETMASK=255.255.255.0

IPADDR=10.0.0.2

USERCTL=no

 

2.配置eth0、eth1文件

# vi ifcfg-eth1

DEVICE=eth1

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes 

USERCTL=no

 

# vi ifcfg-eth2

DEVICE=eth2

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes 

USERCTL=no

3、  

编辑/etc/modprobe.d/bonding.conf文件,加入以下内容   

alias bond0 bonding   

options bond0 miimon=100 mode=1 


1表示主备 0表示负载均衡  

  

4、加入/etc/rc.d/rc.local启动项   

ifenslave bond0 eth0 eth1  

5、启动网卡   

ifconfig bond0 up   

6、重启系统  

7、 cat /proc/net/bonding/bond0可查看bonding状态   

# cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)


Bonding Mode: fault-tolerance (active-backup)

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: eth0

MII Status: down

Speed: Unknown

Duplex: Unknown

Link Failure Count: 2

Permanent HW addr: 18:de:d7:81:ae:34

Slave queue ID: 0


Slave Interface: eth1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 18:de:d7:81:ae:35

Slave queue ID: 0

备注:  

(1)、必须彻底关闭NetworkManger服务,否则会和bond网卡冲突  

service NetworkManger stop  

chkconfig NetworkManger off  

(2)、RHEL 6X版本需要在/etc/modprobe.d/目录下手动新建bonding.conf。

(3)、多個bonging文件配置模式一致  

(4)、设置所有ethxx配置的時候去掉MAC地址。

(5)、服务器网卡绑定需要交换机做主备、堆叠、虚拟化等设置,根据绑定类型不同配置也不同。负载均衡必须开启ACL.


本文出自 “技术成就梦想!” 博客,请务必保留此出处http://369day.blog.51cto.com/845412/1957675

RHEL6.X网卡绑定操作

标签:rhel6   bonding   bond0   

原文地址:http://369day.blog.51cto.com/845412/1957675

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!