rhel7使用nmcli命令配置双网口主备

nmcli程序使用介绍:
O网页链接

备份ifcfg文件后,删除旧的网卡配置
cp ifcfg-eno* legacy/
nmcli con delete eno1
nmcli con delete eno2

重新配置bond组,包括ip
nmcli connection add type bond ifname bond0 mode 1 ip4 192.168.92.20/24 gw4 192.168.92.2
然后将两个网口加入bond
nmcli connection add type bond-slave ifname eno1 master bond0
nmcli connection add type bond-slave ifname eno2 master bond0
大功告成
O网页链接

测试命令:
nmcli dev show
nmcli dev status
nmcli con show

rhel7使用nmcli命令,不需要编辑文件

 

3.3.8. Adding and Configuring a Static Ethernet Connection with nmcli
Adding a Static Ethernet Connection

O网页链接 ​​​​

 

 

O网页链接
redhat7.X与redhat6.X做网卡bond用命令实现配置。 ​​​​

 

 

 

O网页链接

nmcli[ OPTIONS ] OBJECT { COMMAND | help }

OBJECT和COMMAND可以用全称也可以用简称,最少可以只用一个字母,建议用头三个字母。OBJECT里面我们平时用的最多的就是connection和device,这里需要简单区分一下connection和device。

device叫网络接口,是物理设备

     device -show and manage network interfaces

     nmcli device help

connection是连接,偏重于逻辑设置

     connection -start, stop, and manage network connections

     nmcli connection help

多个connection可以应用到同一个device,但同一时间只能启用其中一个connection。这样的好处是针对一个网络接口,我们可以设置多个网络连接,比如静态IP和动态IP,再根据需要up相应connection

 

 

 

cat /proc/net/bonding/bond0
查看bond信息
O网页链接 ​​​​

posted on 2019-05-21 10:26  梓沂  阅读(475)  评论(0)    收藏  举报