NTP服务安装
apt-get install ntp
systemctl start ntp
配置文件在/etc/ntpsec/ntp.conf
双网卡IP配置
修改 /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug enp103s0f0np0 //enp103s0f0np0网卡名 iface enp103s0f0np0 inet static address 10.0.0.80/24 gateway 10.0.0.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 114.114.114.114 allow-hotplug enp103s0f3np3 //enp103s0f3np3网卡名 iface enp103s0f3np3 inet static address 172.16.28.110/24 gateway 10.0.0.254
systemctl restart networking //重启网络服务
ip route add 172.0.0.0/8 via 172.16.28.126 //临时添加内网路由
Debian 13 永久路由配置指南
在 Debian 13 中,添加永久路由主要有两种方式:使用 Netplan (推荐) 和 传统 Interfaces 文件。请根据你的网络管理工具选择对应的方法。
🛠️ 方案一:Netplan (推荐)
适用于大多数现代 Debian 13 安装,配置更灵活,支持多网关和策略路由。📜 方案二:/etc/network/interfaces
适用于旧版配置或特定环境(如某些容器/虚拟机),语法较为传统。1. 方案一:Netplan (Debian 13 默认)
这是最标准的做法。你需要编辑 /etc/netplan/ 目录下的 .yaml 配置文件。
1
定位配置文件
通常位于
/etc/netplan/01-netcfg.yaml 或类似的数字命名文件中。2
修改配置
找到对应网卡(例如
eth0)的配置块,在 addresses 下添加 routes 字段。注意:YAML 文件对缩进非常敏感,
routes 必须与 addresses 同级且缩进一致。3
应用更改
保存后运行以下命令使配置生效:
2. 方案二:/etc/network/interfaces (传统)
如果你的系统依然使用 ifupdown 工具链(部分老旧镜像或特定定制),请使用此方法。
1
编辑文件
打开
/etc/network/interfaces 文件。2
重启服务
保存文件并重启网络服务以应用新路由:

