Debian From Scratch(DFS)配置网络步骤如下:
net-tools(基础网络工具)、NetworkManager(图形界面管理,可选)。/etc/network/interfaces,静态IP示例:auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
DHCP示例:iface eth0 inet dhcp。重启服务:sudo systemctl restart networking。wpasupplicant,编辑/etc/network/interfaces添加:auto wlan0
iface wlan0 inet dhcp
wpa-ssid "your_SSID"
wpa-psk "your_password"
或静态IP配置,同时创建/etc/wpa_supplicant/wpa_supplicant.conf文件。/etc/resolv.conf,添加DNS服务器,如:nameserver 8.8.8.8
nameserver 8.8.4.4
ip addr show查看接口状态,ping www.google.com测试连通性。说明:DFS网络配置与标准Debian一致,优先使用/etc/network/interfaces(传统方法),若需图形界面可安装NetworkManager。