在 Debian/Ubuntu 系统上,永久固定网口的IP地址

通过 systemd-networkd 配置:

1,启用 systemd-networkd 服务:

sudo systemctl enable systemd-networkd

sudo systemctl start systemd-networkd

2,创建网络配置文件

sudo nano /etc/systemd/network/10-static-eth1.network

配置文件内容如下:

Match

Name=eth1

Network

Address=192.168.1.100/24

Gateway=192.168.1.1

DNS=8.8.8.8

3,重启服务:

sudo systemctl restart systemd-networkd

相关推荐
碳基沙盒1 天前
OpenClaw 多 Agent 配置实战指南
运维
蝎子莱莱爱打怪4 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
DianSan_ERP5 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅5 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒5 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
欧云服务器5 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian
智渊AI5 天前
Ubuntu 20.04/22.04 下通过 NVM 安装 Node.js 22(LTS 稳定版)
ubuntu·node.js·vim
zhangfeng11335 天前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh
ZeroNews内网穿透5 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全
失重外太空啦5 天前
nginx
运维·nginx