
1. 单网卡配置IP
(1)查看连接名称,vm一般就是网卡名称。后面命令会用到。
nmcli conn show(2)设置IP
nmcli connection modify ens3 ipv4.method manual ipv4.addresses 192.0.2.1/24 ipv4.gateway 192.0.2.254(3)激活
nmcli connection up ens32. 配置bond网卡及配置IP
(1)创建bond接口
主备模式
nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100"负载模式
nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=balance-rr,miimon=100"(2)添加bond成员
RHEL 9.4后
nmcli connection add type ethernet port-type bond con-name bond0-port1 ifname enp7s0 controller bond0
nmcli connection add type ethernet port-type bond con-name bond0-port2 ifname enp8s0 controller bond0RHEL 9.4前
nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname enp7s0 master bond0
nmcli connection add type ethernet slave-type bond con-name bond0-port2 ifname enp8s0 master bond0(3)设置IP
nmcli connection modify bond0 ipv4.addresses '192.0.2.1/24' ipv4.gateway '192.0.2.254' ipv4.method manual(4)激活bond0
nmcli connection up bond0注意,在激活bond0之前,会一直打印从bond0移除ens3的信息。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。