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
相关推荐
阿成学长_Cain2 小时前
Linux telinit 命令详解:运行级别切换|关机重启|系统维护一站式掌握
linux·运维·前端·网络
NiceCloud喜云3 小时前
Anthropic 一周三连发:Cowork 多端、Fable 5 按需付费、J-space 论文的技术解读
java·服务器·网络·人工智能·ai
门思科技3 小时前
TKL + EB:重新定义 LoRaWAN 在存量设备改造中的价值,让传统设备快速接入物联网
网络·物联网
hai3152475434 小时前
九章芯片电路集成体系:密度矩阵逆向·全域均衡网络计算总框架
网络·线性代数·矩阵
DLYSB_4 小时前
《从零开始搭建机房轻量化“声光告警”系统:基于 HTTP API 与 TTS 的运维实践》
运维·网络协议·http·报警灯
芝麻馅汤圆儿4 小时前
跨三层环境(交换机vlan/vlanif配置)
网络
ZhengEnCi4 小时前
N3A-一个端口只能给一个程序使用吗?
网络协议
发光的沙子4 小时前
FPGA----配置根文件系统ip和mac地址
网络协议·tcp/ip·macos
wjql24 小时前
手机远程操控另一台手机的方法 手机可以远程操控手机吗
网络
奶油话梅糖5 小时前
锐捷常用命令速查表
java·网络·windows