导读 本文主要讲解如何重启RHEL 8或者CentOS 8网络以及如何解决RHEL8和CentOS8系统的网络管理服务报错

1、redhat8系列官方使用nmclit进行IP地址修改和配置:

将network停止并禁止:

systemctl stop network
systemctl mask network

并启用NetworkManager:

systemctl start NetworkManager
systemctl enable NetworkManager
mcli connection modify ens33(网卡名) ipv4.addresses 172.16.30.100/24 ipv4.gateway 172.16.30.1 ipv4.dns 172.16.30.243 connection.autoconnect yes(自动连接) ipv4.method manual(手动配置)

mcli connection modify ens33(网卡名) connection.autoconnect no(不自动连接) ipv4.method auto(自动获取)

nmclit connection down ens33(网卡名称)
nmclit connection up ens33(网卡名称)
systemctl restart NetworkManager ###重启服务
2、查看网卡硬件设备
nmclit device show ###查看硬件设备

nmcli connection delete ens33 ###删除网卡配置

nmcli connection add type ethernet con-name enss33 ifname ens33 connection.autoconnect yes
创建网卡类型为以太网,名字叫enss33,匹配硬件网卡ens33,并自动连接

配置DNS:vi /etc/resolv.conf
假如nameserver 202.96.104.17

修改主机名:hostnamectl set-hostname JT-XX-040

原文来自:https://blog.csdn.net/mwb55/article/details/108402277?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control

本文地址:https://www.linuxprobe.com/network-configuration-dns.html编辑:王华超,审核员:逄增宝

Linux命令大全:https://www.linuxcool.com/