代码改变世界

RHEL7 -- 使用team替换bonding实现链路聚合网卡绑定

2015-08-17 22:06  abce  阅读(2112)  评论(0编辑  收藏  举报
将网卡enp0s8、enp0s9进行链路绑定

安装teamd包
# yum install teamd

创建一个team链接
# nmcli con add con-name team0 type team ifname team0 config '{"runner":{“name”:"activebackup"}}'
Connection 'team0' (7100f55b-3fa5-46d3-84e8-26803f2a6117) successfully added.

将两个网卡加进来
# nmcli con add type team-slave con-name team0-slave1 ifname enp0s8 master team0
Connection 'team0-slave1' (061bc662-c233-4350-9a8a-3893e6ff59c2) successfully added.
# nmcli con add type team-slave con-name team0-slave2 ifname enp0s9 master team0
Connection 'team0-slave2' (6ac26f01-c19d-4a1d-af1e-140bc0a4ac5d) successfully added.

为聚合网卡配置ip,设置manual属性
# nmcli con mod team0 ipv4.addresses 192.168.56.123/24 ipv4.method manual

启动聚合链接
# nmcli con up team0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)

查看状态
# teamdctl team0 state
setup:
  runner: activebackup
ports:
  enp0s8
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
  enp0s9
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
runner:
  active port: enp0s9