Centos8.5绑定网卡(BONDING、TEAM)
前置知识
Cenos8刷新配好的网络一定要按照底下的顺序
nmcli c reload
nmcli networking off
nmcli networking on
Team绑定
概述
环境:centos8.5,两个网卡(ens33,ens37)
绑定ens33和ens37,绑定的网卡叫做team-eth0
创建team口
nmcli connection add type team con-name team0 ifname team-eth0 config '{"runner":{"name":"activebackup"}}'
去查看team口
nmcli con show
nmcli connect modify team0 ipv4.addresses "192.168.76.8/24"
nmcli connect modify team0 ipv4.gateway "192.168.76.2"
nmcli connect modify team0 ipv4.dns "8.8.8.8"
nmcli connect modify team0 ipv4.method manual
nmcli connection add type team-slave con-name team0-port1 ifname ens33 master team0
nmcli connection add type team-slave con-name team0-port2 ifname ens36 master team0
nmcli con up team0-port2
nmcli con up team0
查看
nmcli connection show
二、BONDING绑定
使用nmcli工具的方式
- 查看物理网卡信息
nmcli device
- 查看网卡连接信息
nmcli connection show
- 删除已有connection的物理网卡信息
nmcli connection delete ens33
nmcli connection delete ens37
nmcli connection show
- 创建绑定网卡bond0 并设置IP地址
nmcli connection add type bond ifname bond0 con-name bond0 miimon 100 mode active-backup primary ens33 ipv4.method manual ipv4.addresses 192.168.221.232/24 ipv4.gateway 192.168.221.25
- 创建bond0的子接口
nmcli connection add type bond-slave ifname ens33 con-name bond0-ens33 master bond0
nmcli connection add type bond-slave ifname ens37 con-name bond0-ens37 master bond0
- 查看已激活的网络接口
nmcli connection show --active
- 查看bond0状态
cat /proc/net/bonding/bond0
标签:bond0,nmcli,绑定,team0,网卡,connection,con,双网卡,centos8 From: https://www.cnblogs.com/waacode/p/17539417.html