Linux:Centos9:配置固定ip

centos9的网卡位置移动到了 /etc/NetworkManager/system-connections/ 下面

查看网卡

复制代码
ifconfig

当前有两块网卡,我要去配置ens160的一个固定的ip,让其ip为192.168.6.20/24,网关为192.168.6.254.dns为:1.1.1.1

复制代码
vim /etc/NetworkManager/system-connections/ens160.nmconnection
复制代码
[connection]
id=ens160
uuid=44657eba-8ca8-31e6-b455-88d782c6c395
type=ethernet
autoconnect-priority=-999
interface-name=ens160

[ethernet]

[ipv4]
#method=auto
method=manual
address1=192.168.6.20/24,192.168.6.254
dns=1.1.1.1

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]

配置完数据后重启网卡

复制代码
nmcli c reload ens160

这样就成功配置了网卡了

相关推荐
babytiger8 小时前
Gitea 重安装 + Snap 数据迁移完整流程总结
linux·elasticsearch·gitea
匆匆那年9678 小时前
远程 Linux 校园网认证操作手册(本地浏览器法)
linux·运维·服务器
dog2509 小时前
为何新增网络路径反而引入额外时延
服务器·网络·php
newnazi9 小时前
RedHat10 安装MS SQL Server2025
linux·服务器·数据库
zkkkkkkkkkkkkk9 小时前
Linux进行管理工具Supervisor配置与使用
linux·python·supervisor
爱喝水的鱼丶9 小时前
SAP-ABAP:ABAP函数 NUMBER_GET_NEXT 详解:从编号范围对象获取下一个编号
运维·数据库·学习·sap·abap
开发者联盟league9 小时前
linux普通用户使用pip安装模块
linux·python·pip
QuestLab9 小时前
③-进阶篇:vLLM实战——多卡部署、压测与排障
linux·服务器·网络
Languorous.9 小时前
Windows 安装 Linux 虚拟机 / WSL 完整教程(新手零失败)
linux·运维·windows
ElevenS_it18810 小时前
K8s容器环境运维监控盲区:从Node到Pod到Service的可观测性分层实战
运维·容器·kubernetes