目录
前言
在完成openEuler的安装与基本运行后,接下来将深入探讨如何进一步配置openEuler系统,以充分发挥其性能和功能。本章节主要介绍openEuler的网络配置内容。
一、静态IP配置
1、切换到网卡配置目录
cd /etc/sysconfig/network-scripts
2、配置静态IP
修改及添加如下配置信息
3、激活连接并检查状态
nmcli con up ens33 ifname ens33
4、重启网卡
systemctl restart NetworkManager
5、检查网卡连接状态:
nmcli device status
二、双网卡绑定配置
openEuler需要通过NetworkManager的命令行工具使用nmcli命令进行bond0网卡配置文件的创建(注:手动创建bond0文件配置不生效亲测):
2.1、nmcli创建绑定接口:
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
可生成一个bond0网卡配置文件:
2.2、网卡添加:
(如果网卡配置文件已存在不需要添加,直接修改 ens33和ens34网卡配置即可):
nmcli con add type ens33 ifname ens33 master bond0
nmcli con add type ens34 ifname ens34 master bond0
修改 ens33和ens36网卡配置:
[root@localhost network-scripts]# cat ifcfg-ens34
TYPE=Ethernet
NAME=ens34
DEVICE=ens34
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]#
[root@localhost network-scripts]#
[root@localhost network-scripts]# cat ifcfg-ens33
TYPE=Ethernet
NAME=ens33
DEVICE=ens33
ONBOOT=yes
MASTER=bond0
SLAVE=yes
配置修改bond0网卡:
[root@localhost network-scripts]# cat ifcfg-bond0
BONDING_OPTS=mode=active-backup
TYPE=Bond
BONDING_MASTER=yes
BOOTPROTO=none
NAME=bond0
DEVICE=bond0
ONBOOT=yes
IPADDR=192.168.159.149
PREFIX=24
GATEWAY=192.168.159.1
2.3、重启网卡:
systemctl restart NetworkManager
2.4、网卡激活:
nmcli con up ens33
nmcli con up ens34
nmcli con up bond0
2.5、查看网卡激活状态:
nmcli device status
如下图,可观察到双网卡绑定配置已完成
三、总结
通过上述步骤,能够成功完成openEuler系统网络的配置,如果您在网络配置过程中遇到任何问题,可私信我,后续为大家持续更新openEuler欧拉系统的常见问题及配置解决方法