安装类型

安装语言环节



网络配置


创建用户





磁盘分区



创建主分区






创建逻辑分区








配置软件包管理器






设置静态IP
bash
ip a # 查看ip

bash
cp -rf /etc/network/interfaces /etc/network/interfaces_back # 【ROOT用户下】备份网络接口配置文件
bash
nano /etc/network/interfaces # 【ROOT用户下】编辑网络接口配置信息
auto ens33 #开机自启
allow-hotplug ens33 #开启配置热生效
iface ens33 inet static
address 192.168.105.188 #静态IP地址
netmask 255.255.255.0 #子网掩码
gateway 192.168.105.2 #子网掩码
bash
nano /etc/resolv.conf # 【ROOT用户下】配置DNS
nameserver 192.168.105.2
nameserver 8.8.8.8
bash
systemctl restart networking.service # 重启网络服务
配置镜像
- Debian13可能使用传统的/etc/apt/sources.list,也可能使用新 DEB822 格式 /etc/apt/sources.list.d/debian.sources
bash
# A:如果是【/etc/apt/sources.list】则追加如下
cp -rf /etc/apt/sources.list /etc/apt/sources.list.back # 【ROOT用户下】备份历史数据
nano /etc/apt/sources.list # 【ROOT用户下】替换为如下内容
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
bash
# B:如果使用的是 /etc/apt/sources.list.d/debian.sources(DEB822 格式)
# 将 http://deb.debian.org/debian 替换为 https://mirrors.tuna.tsinghua.edu.cn/debian
修复 DNS 配置
bash
nano /etc/resolv.conf #【ROOT用户下】追加如下内容
nameserver 223.5.5.5
nameserver 119.29.29.29
bash
ping -c 3 mirrors.tuna.tsinghua.edu.cn # 验证解析是否恢复
bash
apt update #【ROOT用户下】更新软件包索引
配置防火墙
- Debian13 默认没有启用任何防火墙服务,网络流量默认处于全部放行的状态。不过其系统底层默认使用的防火墙框架是 nftables
- 虽然框架是 nftables,但 Debian 的默认安装并不会自动加载一套限制性的防火墙规则。除非你手动安装并启用了 nftables 服务或配置了规则,否则系统不会对网络流量进行任何过滤
- 如果不想引入额外工具,可以直接管理 nftables。Debian 默认的规则文件位于 /etc/nftables.conf
bash
apt install nftables # 【ROOT用户下】安装/升级nftables
systemctl enable nftables && systemctl restart nftables
bash
systemctl status nftables

打开或关闭端口
- 不用 UFW 的话,在 Debian 13 上主要有两个成熟的选择:直接使用 nftables(系统默认底层框架),或者使用 firewalld(另一个管理前端)。它们的关系和适用场景不太一样
- nftables:性能最好,规则表达能力强,是 Debian 官方推荐的新防火墙构建方式。缺点:需要自己写规则文件,语法相对底层
bash
nano /etc/nftables.conf #【ROOT用户下】编辑配置文件并写入你的放行和拒绝规则
systemctl restart nftables
查看端口监听列表
bash
apt install net-tools # 【ROOT用户下】安装netstat
lsof -i :80 # 【ROOT用户下】查看80端口监听列表
bash
ss -tulnp # 【ROOT用户下】
-t:显示 TCP 端口
-u:显示 UDP 端口
-l:仅显示处于监听状态的端口
-n:以数字形式显示端口号(不解析为服务名,速度更快)
-p:显示占用端口的进程名和 PID(需 sudo 权限才能看到其他用户的进程)