AlmaLinux 9 上配置静态 IP 地址

在 Rocky Linux 9 中,密钥文件的新默认存储位置在 /etc/NetworkManager/system-connections 中

shell 复制代码
cd /etc/NetworkManager/system-connections
默认dhcp配置
shell 复制代码
~                                                                                                                                                                                                                                    
"ens33.nmconnection" 21L, 299B                                                                                                                                                                                     15,19         All
[connection]
id=ens33
uuid=77c1e2f2-fe9d-3b54-a1cc-ea306b4261e4
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1725853338

[ethernet]

[ipv4]
method=auto

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

[proxy]
修改配置
shell 复制代码
~                                                                                                                                                                                                                                    
"ens33.nmconnection" 21L, 299B                                                                                                                                                                                     15,19         All
[connection]
id=ens33
uuid=77c1e2f2-fe9d-3b54-a1cc-ea306b4261e4
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1725853338

[ethernet]

[ipv4]
#手动设置
method=manual
#IP/网关地址
address1=192.168.50.4/192.168.50.1
# DNS服务器
dns=114.114.114.114


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

[proxy]

修改

dart 复制代码
[ipv4]
method=manual
# IP/子网掩码,网关
address1=192.168.112.22/24,192.168.112.1
# DNS服务器
dns=172.16.8.220
重新加载配置文件,注意我的网卡id是id=ens33,所以重载ens33
dart 复制代码
nmcli connection reload ens33.nmconnection
nmcli connection up ens33
相关推荐
JoySSLLian21 小时前
手把手教你安装免费SSL证书(附宝塔/Nginx/Apache配置教程)
网络·人工智能·网络协议·tcp/ip·nginx·apache·ssl
Zach_yuan21 小时前
自定义协议:实现网络计算器
linux·服务器·开发语言·网络
猫头虎21 小时前
如何解决 OpenClaw “Pairing required” 报错:两种官方解决方案详解
网络·windows·网络协议·macos·智能路由器·pip·scipy
charlotte102410241 天前
高并发:关于在等待学校教务系统选课时的碎碎念
java·运维·网络
Zaralike1 天前
Linux 服务器网络不通排查 SOP(标准操作流程)
linux·服务器·网络
云姜.1 天前
网络协议----OSI七层网络协议 和 TCP/IP四层(五层)网络协议
网络·网络协议
!chen1 天前
LabVIEW TCP Server端工具TCP通信
网络·tcp/ip·labview
枷锁—sha1 天前
【SRC】SQL注入快速判定与应对策略(一)
网络·数据库·sql·安全·网络安全·系统安全
郝学胜-神的一滴1 天前
深入解析C/S模型下的TCP通信流程:从握手到挥手的技术之旅
linux·服务器·c语言·网络·网络协议·tcp/ip
池央1 天前
CANN 算子诊断与故障定位:oam-tools 在异构计算错误解析中的作用
网络