Debian 环境下网络问题的排查与修复
一、快速定位流程
二、常见故障与修复要点
三、配置管理与工具选择
四、性能与稳定性优化
五、最小可用配置示例
静态 IP(/etc/network/interfaces)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 114.114.114.114
应用:sudo systemctl restart networking
DHCP(/etc/network/interfaces)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
应用:sudo systemctl restart networking
使用 NetworkManager(nmcli)
nmcli con mod "ens160" ipv4.method manual \
ipv4.addresses 192.168.1.100/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con up "ens160"