/etc/sysconfig/network-scripts/
之下的脚本,系统也没有名叫network
的服务。Rocky Linux通过“系统连接”管理网卡及IP,修改、新增*.nmconneciton文件可以完成对操作系统的IP配置。
此处修改初始IP的配置命令如下:
[root@localhost system-connections]# cd /etc/NetworkManager/system-connections/
[root@localhost system-connections]# ll
total 4
-rw-------. 1 root root 256 Nov 15 2022 'Ethernet ection'
[root@localhost system-connections]# vim Ethernet connection 1.nmconnection
[root@localhost system-connections]#
[connection]
id=ens192
uuid=14d47b8e-b926-4fa9-b962-f057bc015d8b
type=ethernet
interface-name=ens192
timestamp=1681721746[ethernet][ipv4]
address1=10.42.40.45/24,10.42.40.1
dns=10.42.40.1;
method=auto[ipv6]
addr-gen-mode=default
method=auto[proxy]
参考以下命令:
service NetworkManager restart #IP配置不生效
nmcli connection reload ens192 #IP配置不生效
nmcli connection down ens192 #先断开网卡,再次连接网卡,IP配置生效。
nmcli device
nmcli connection up ens192 #先断开网卡,再次连接网卡,IP配置生效。
nmcli device
ifconfig
本文发布于:2024-02-01 18:10:14,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170678236838512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |