Debian Stream 8配置网络常用方法如下:
/etc/network/interfaces文件配置:
nano)打开/etc/network/interfaces,添加或修改内容,如auto eth0、iface eth0 inet static、address IP地址、netmask 子网掩码、gateway 网关地址、dns-nameservers DNS服务器地址。inet static改为inet dhcp。sudo systemctl restart networking。sudo apt-get update,sudo apt-get install network-manager。sudo systemctl enable NetworkManager,sudo systemctl start NetworkManager。nm-connection-editor命令打开图形界面配置。netplan配置(适用于较新版本,可能需先安装):
sudo apt-get update,sudo apt-get install netplan.io。/etc/netplan/01-netcfg.yaml),示例内容为network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no addresses: [IP地址/子网掩码] gateway4: 网关地址 nameservers: addresses: [DNS服务器地址]。sudo netplan apply。