Loading... # CentOS9 配置静态 ip 地址 ## 编辑网卡信息 路径 ``` vim /etc/NetworkManager/system-connections/ens160.nmconnection ``` 可以看到: ``` [connection] id=ens160 uuid=324370d4-f1dd-37a9-8e37-fa5230f29b86 type=ethernet autoconnect-priority=-999 interface-name=ens160 timestamp=1744154426 [ethernet] [ipv4] method=auto [ipv6] addr-gen-mode=eui64 method=auto [proxy] ``` 添加: ``` [ipv4] # method=auto method=manual addresses=192.168.10.100/24 gateway=192.168.10.2 dns=8.8.8.8; dns-search= ``` ## 激活配置 `保存后运行以下命令激活配置:` ``` nmcli connection reload nmcli connection up ens160 ``` `如需测试网络连通性,可以执行` ``` ping -c 4 192.168.10.2 ping -c 4 8.8.8.8 ``` 最后修改:2025 年 04 月 09 日 © 允许规范转载 打赏 赞赏作者 赞 咱们谁跟谁,用不着~