话说最近折腾了2个虚拟机模版,CentOS-Stream-9 和ubuntu 22.04 这是其中一篇,因为是半个任务,这2个发行版我都是看不上的,CentOS-Stream-9,我用 rockylinux 不香一点么,ubuntu 换成 debian 11不香么,果然 CentOS-Stream-9 果然就躺坑了。
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/
下了一个 CentOS-Stream-9-20220606.0-x86_64-dvd1.iso
果然有大坑,后来下了 CentOS-Stream-9-20220621.1-x86_64-dvd1.iso 坑少点了,毕竟 9还没正式出,等正式发布估计会好点吧。
为了证明我装过,截几个图了。
勾选允许 root 用户登陆ssh
网卡配置方式变了, 原来的 /etc/sysconfig/network-scripts/ifcfg-* 找不到了。
grep -rnw '/etc' -e 'ens192'
发现跑这里了,初始配置长这样
cat /etc/NetworkManager/system-connections/ens192.nmconnection:2:id=ens192
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[connection] id=ens192 uuid=1f7c44a9-10d6-3cfb-841a-a1c494e10a66 type=ethernet autoconnect-priority=-999 interface-name=ens192 timestamp=1655185237 [ethernet] [ipv4] method=auto [ipv6] addr-gen-mode=eui64 method=auto [proxy] |
手动配置的话,要长这样
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# cat /etc/NetworkManager/system-connections/ens192.nmconnection [connection] id=ens192 uuid=1f7c44a9-10d6-3cfb-841a-a1c494e10a66 type=ethernet autoconnect-priority=-999 interface-name=ens192 timestamp=1655185237 [ethernet] [ipv4] method=manual address1=10.29.1.64/16,10.29.100.1 DNS1=192.168.1.29 [ipv6] addr-gen-mode=eui64 method=auto [proxy] |
1 2 |
nmcli c reload # 重新加载配置文件 nmcli c up ens192 # 重启ens192网卡 |
遇到的坑
nmcli c reload 报错
Error: failed to reload connections NetworkManager is not running.
systemctl status NetworkManager
1 2 3 4 |
May 26 11:04:30 systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 3. May 26 11:04:30 systemd[1]: Stopped Network Manager. May 26 11:04:30 systemd[1]: Dependency failed for Network Manager. May 26 11:04:30 systemd[1]: NetworkManager.service: Job NetworkManager.service/start failed with result 'dependency'. |
还有一个报错
离谱,要手动启动一下才能有网络
- NetworkManager: bus-manager: cannot connect to D-Bus: Error receiving data: Connection reset by peer
- systemd: Failed to start Network Manager
- systemd: Failed to start D-Bus System Message Bus
- systemd: Failed to listen on D-Bus System Message Bus Socke
文章评论