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
相关推荐
2401_8414956426 分钟前
【计算机网络】计算机网络体系结构与参考模型
网络·计算机网络·ip·tcp·osi·分层结构·协议数据单元
QT 小鲜肉1 小时前
【QT/C++】Qt网络编程进阶:TCP网络编程的基本原理和实际应用(超详细)
c语言·开发语言·网络·c++·qt·学习·tcp/ip
大隐隐于野9 小时前
tcp 丢包分析
linux·服务器·网络
qqxhb10 小时前
系统架构设计师备考第64天——网络构建关键技术
网络·系统架构·mtbf·mttr·冗余硬件·软件热备·快速检测
哈乐14 小时前
网工应用题:配置命令补全类题目
服务器·前端·网络
张人玉14 小时前
C# TCP 服务器和客户端
服务器·tcp/ip·c#
雯0609~14 小时前
宝塔配置:IP文件配置,根据端口配置多个项目文件(不配置域名的情况)
服务器·网络协议·tcp/ip
梁正雄14 小时前
19、docker跨主机网络 Overlay\Underlay
网络·docker·容器
沧澜sincerely14 小时前
运输层协议概述及UDP
网络·udp·运输层
国科安芯15 小时前
抗辐照MCU芯片在无人叉车领域的性能评估与选型建议
网络·人工智能·单片机·嵌入式硬件·安全