[关闭]
@cdmonkey 2016-12-20T02:12:40.000000Z 字数 1294 阅读 1412

bonding

操作系统


http://www.cnblogs.com/dkblog/p/3613407.html

1. 绑定模式

网卡绑定的“mode”共有七种:bond0、bond1、bond2、bond3、bond4、bond5、bond6

常用的有三种:

2. 绑定操作

  1. [root@PBSPTS01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
  2. DEVICE=bond0
  3. BOOTPROTO=static
  4. ONBOOT=yes
  5. IPADDR=192.168.120.5
  6. NETMASK=255.255.255.0
  7. GATEWAY=192.168.120.1
  1. DEVICE=eth0
  2. BOOTPROTO=static
  3. HWADDR=B4:99:BA:B5:19:FC
  4. ONBOOT=yes
  5. MASTER=bond0
  6. SLAVE=yes
  1. DEVICE=eth1
  2. BOOTPROTO=static
  3. HWADDR=B4:99:BA:B5:19:FE
  4. ONBOOT=yes
  5. MASTER=bond0
  6. SLAVE=yes
  1. [root@PBSPTS01 ~]# vim /etc/modprobe.d/bonding.conf
  2. # Bonding the eth0 & eth1
  3. alias bond0 bonding
  4. options bond0 miimon=100 mode=1

完成上面的操作后还需要确认相关的模块是否被加载:

  1. [root@PBSPTS01 ~]# lsmod | grep bonding
  2. bonding 131724 0

检查一下绑定后的网卡:

  1. [root@PBSPTS01 ~]# cat /proc/net/bonding/bond0
  2. Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
  3. Bonding Mode: fault-tolerance (active-backup)
  4. Primary Slave: None
  5. Currently Active Slave: em1
  6. MII Status: up
  7. MII Polling Interval (ms): 100
  8. Up Delay (ms): 0
  9. Down Delay (ms): 0
  10. Slave Interface: em1
  11. MII Status: up
  12. Speed: 1000 Mbps
  13. Duplex: full
  14. Link Failure Count: 0
  15. Permanent HW addr: 14:18:77:49:c0:8b
  16. Slave queue ID: 0
  17. Slave Interface: em2
  18. MII Status: down
  19. Speed: Unknown
  20. Duplex: Unknown
  21. Link Failure Count: 0
  22. Permanent HW addr: 14:18:77:49:c0:8c
  23. Slave queue ID: 0
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注