接上篇文章讲了?Ubuntu 18及以上版本的配置方法,本文再来讲讲 CentOS 8 及以上版本配置 IP 的方法。
Answers the previous article on how to configure Ubuntu 18 and above, and in this case on how to configure CentOS 8 and the above version IP.
说明:CentOS 8 是新发布的系统(发布时间:2019.9),IP 配置方式和以前版本不一样。使用 NetworkManager工具配置。
Note: CentOS 8 is a newly issued system (issue time: 2019.9), the IP configuration is different from the previous version. Use the NetworkManager tool configuration.
而以前的版本时通过修改配置文件来配置,并由network.service 提供服务。
The previous version was configured by modifying the profile and served by network.service.
CentOS 8 已废弃 network.service,默认只能通过NetworkManager.service 提供的 nmcli 命令修改网络配置
CentOS 8 has been abandoned network. service, defaulting to modify network configurations only by nmcli command provided by NetworkManager.service
当然如果希望 8 版本以后支持修改配置文件的方式,需要安装 network.service
Of course, if you want version 8 to support the way the profile is modified, you need to install network.service
配置静态 IP:
Configure static IP:
配置动态 IP:
Configure dynamic IP:
修改IP(非交互式):
Modify IP (non-interactive):
修改 IP(交互式):
Modify IP (interactive):
查看 ip(类似于、):
View ip (similar to:
这里也说下之前版本的配置方法,让大家有个对比。
And here's the previous version of the configuration, so let's make a comparison.
修改对应网卡的 IP 地址的配置文件
Modify the configuration file for IP addresses of the Internet cards
修改以下内容:
Amend the following:
其中,包括 IP、网关、DNS 等
Among them are IPs, gateways, DNSs, etc.
网关地址可以通过上面的方式配置,也可以修改下面网关的配置文件:
The gateway address can be configured in the same way as above, or the following gateway profile can be modified:
修改以下内容:
Amend the following:
同样,DNS 可以用上面的方式配置,也可以修改 DNS 配置文件:
Similarly, the DNS can be configured in the way above, or the DNS profile can be modified:
修改以下内容:
Amend the following:
最后,记得重新启动网络配置生效:
Finally, it is important to recall that the reboot of the network configuration is in effect:
注意:文章说的都是永久生效方式,临时生效就是用或命令配置即可。
N.B. The articles are all about the permanent mode of entry into force, and provisional entry into force is simply the use or configuration of the order.
OK,今天的文章不用五分钟,相信大家已经 get 了两个新技能。如果觉得有帮助,不妨动动手指给个点赞吧,谢谢!
OK, today's article won't take five minutes, and I'm sure you've got two new skills. If it helps, move your fingers. Thank you.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论