50.bonding&team
bonding&team
bonding 配置
通过 NetworkManager 守护进程来控制绑定接口。首先需要明确以下几点:
- 启动主接口 (master interface) 不会自动启动从接口 (slave interface)
- 启动从接口永远都会启动主接口
- 停止主接口会自动停止从接口
- 还没有从接口的主接口可以配置静态 IP
- 当使用 DHCP 时,还没有从接口的主接口需要等待从接口的加入
- A master with a DHCP connection waiting for slaves completes when a slave with a carrier is added.
- A master with a DHCP connection waiting for slaves continues waiting when a slave without a carrier is added.
Using Nmtui GUI to Configure a bonding Interface
Using Nmcli to Create Bond
Create Bond Connection
nmcli con add type bond ifname bond-name |
NetworkManager Command Line (nmcli) 支持绝大多数 kernel 提供的 bonding 配置。例如:
nmcli con add type bond ifname bond-name bond.options "mode=balance-rr,miion=100" |
Add a Slave Interface
添加 slave 网卡时,master connection 设置为 bond connection 名称。
nmcli con add type ethernet ifname ens33 master bond-name |
激活从网卡
nmcli con up bond-slave-ens33 |
active_slave
和 primary
参数可以不影响 bond 接口工作的情况下进行修改。
nmcli dev mod bond-name +bond.options "active_slave=ens33" |
使用 CLI 激活 bonding
在 RHEL 7 中,bonding 模块默认不打开。需要使用 root 权限加载模块:
modprobe --first-time bonding |
team 配置
nmcli connection add con-name team0 type team ifname team0 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Laplace' Café!
评论