FetchDebian并非官方工具,其网络配置可参考Debian系统通用方法,主要有以下两种方式:
编辑配置文件
/etc/netplan/*.yaml文件(如01-netcfg.yaml),示例内容:network:
version: 2
ethernets:
eth0:
dhcp4: no
addresses: [192.168.1.100/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
/etc/network/interfaces,添加: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 8.8.4.4
应用配置
sudo netplan apply(netplan方式)或sudo systemctl restart networking(传统方式)。/etc/netplan/*.yaml中设置dhcp4: true。/etc/network/interfaces中添加iface eth0 inet dhcp。sudo netplan apply或sudo systemctl restart networking。ip addr show eth0查看IP是否生效。注:具体操作需根据实际网络环境和Debian版本调整,建议优先参考官方文档。