CentOS怎么配置bond


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

[root@Linux ~]# route

     

Kernel IP routing table

     

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

     

10.0.0.0        *               255.255.255.0   U     0      0        0 bond0

     

10.0.0.0        *               255.255.255.0   U     0      0        0 eth0

     

10.0.0.0        *               255.255.255.0   U     0      0        0 eth1

     

169.254.0.0     *               255.255.0.0     U     0      0        0 bond0

     

default         10.0.0.1        0.0.0.0         UG    0      0        0 bond0

     

  

     

vi  ifcfg-eth0

     

  

     

DEVICE=eth0

     

BOOTPROTO=none

     

ONBOOT=yes

     

USERCTL=no

     

MASTER=bond0

     

SLAVE=yes

     

  

     

vi  ifcfg-eth1

       

  

       

DEVICE=eth1

       

BOOTPROTO=none

       

ONBOOT=yes

       

USERCTL=no

       

MASTER=bond0

       

SLAVE=yes

3 # vi /etc/modprobe.conf

编辑/etc/modprobe.conf 文件,加入如下一行内容,以使系统在启动时加载bonding模块,对外虚拟网络接口设备为 bond0

  加入下列两行

1

2

3

alias bond0 bonding

       

options bond0 miimon=100 mode=0

说明:

miimon是用来进行链路监测的。 比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路;

mode的值表示工作模式,他共有0,1,2,3四种模式,常用的为0,1两种。

mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。

mode=1表示fault-tolerance (active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份.

4 # vi /etc/rc.d/rc.local

加入以下内容

1

2

3

4

5

# 仅在热备模式下,eht0 eth1网卡的工作顺序.

         

  

         

ifenslave bond0 eth0 eth1

到这时已经配置完毕重新启动机器.

重启会看见以下信息就表示配置成功了

................

1

2

3

4

5

Bringing up interface bond0 OK

         

Bringing up interface eth0 OK

         

Bringing up interface eth1 OK

2、配置Bond 1 热备模式

特点:

1. 正在工作的网卡不正常后,切换到备用网卡,此时会中间几秒钟

2. 恢复不正常的网卡时,不会引发网络中断.

其他步骤一致,只在第3步骤,将mode设置成1即可.

1

2

3

alias bond0 bonding

         

options bond0 miimon=100 mode=1

以上就是CentOS怎么配置bond的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

如何查看CentOS下mysql是否安装成功

CentOS打不开eclipse怎么办?

如何解决CentOS无法获取ip

CentOS无法访问ssh怎么办?

CentOS系统下nginx无法解析php

CentOS系统下不显示中文怎么办

CentOS中nat模式下静态ip连接外网

CentOS php无法启动怎么办

如何解决在CentOS下mysql.h找不到

如何查看CentOS版本号

更多相关阅读请进入《CentOS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...