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
相关推荐
.select.41 分钟前
HTTPS RSA 握手解析
服务器·网络协议·https
qq_452396238 小时前
【AI 架构师】第十篇:Agent 工业化部署 —— 从 FastAPI 到云端全链路监控
网络·人工智能·ai·fastapi
globaldomain8 小时前
什么是用于长距离高速传输的TCP窗口扩展?
开发语言·网络·php
桌面运维家10 小时前
Win10打印机共享故障排查:权限与网络配置详解
开发语言·网络·php
众创五舟战神:l_e012010 小时前
shopee(虾皮)买家号系统搭建:安全下单攻略
网络·安全
中议视控11 小时前
RTSP和RTSM编码推送软件让中控系统控制实现可视化播控
网络·分布式·物联网·5g·音视频
线束线缆组件品替网13 小时前
Amphenol RJE1Y22A53644401线束详解与替代网络线束选型指南
运维·服务器·网络·智能路由器·电脑·51单片机
Du_chong_huan13 小时前
3.2 无连接运输:UDP 协议|《计算机网络:自顶向下方法》精读
网络协议·计算机网络·udp
SeanDe14 小时前
Linux grep 命令用法详解
linux·服务器·网络
志栋智能15 小时前
告别高昂投入:超自动化IT运维的轻量化实践
大数据·运维·网络·人工智能·自动化