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

这样就成功配置了网卡了

相关推荐
BD_Marathon11 分钟前
SpringBoot——辅助功能之切换web服务器
服务器·前端·spring boot
晚风吹人醒.40 分钟前
SSH远程管理及访问控制
linux·运维·ssh·scp·xshell·访问控制·远程管理
Uncertainty!!2 小时前
Linux多用户情况下个别用户输入密码后黑屏
linux·远程连接
necessary6532 小时前
使用Clion查看linux环境中的PG源码
linux·运维·服务器
江湖有缘3 小时前
Jump个人仪表盘Docker化部署教程:从0到 搭建专属导航页
运维·docker·容器
小猪佩奇TONY3 小时前
Linux 内核学习(14) --- linux x86-32 虚拟地址空间
linux·学习
Lam㊣4 小时前
Centos 7 系统docker:更换镜像源
linux·docker·centos
FL16238631294 小时前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
石头5304 小时前
Kubernetes监控全栈解决方案:从零搭建Prometheus+Grafana监控体系
linux
ha20428941944 小时前
Linux操作系统学习记录之---TcpSocket
linux·网络·c++·学习