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
相关推荐
pipip.11 分钟前
UDP————套接字socket
linux·网络·c++·网络协议·udp
Félix25114 分钟前
计算机网络笔记(不全)
网络·计算机网络
阳洞洞1 小时前
https和http有什么区别
网络协议·http·https
朱包林3 小时前
day45-nginx复杂跳转与https
linux·运维·服务器·网络·云计算
孞㐑¥5 小时前
Linux之Socket 编程 UDP
linux·服务器·c++·经验分享·笔记·网络协议·udp
you秀5 小时前
HTTPS通信流程:SSL/TLS握手全解析
网络协议·https·ssl
2501_915921437 小时前
iOS IPA 混淆实测分析:从逆向视角验证加固效果与防护流程
websocket·网络协议·tcp/ip·http·网络安全·https·udp
2501_915918417 小时前
打造可观测的 iOS CICD 流程:调试、追踪与质量保障全记录
websocket·网络协议·tcp/ip·http·网络安全·https·udp
Absinthe_苦艾酒9 小时前
计算机网络(三)传输层TCP
网络·tcp/ip·计算机网络
GLAB-Mary10 小时前
AI会取代网络工程师吗?理解AI在网络安全中的角色
网络·人工智能·web安全