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若希望通过 DHCP 自动获取 IP 地址,则可以使用以下配置:
auto eth0
iface eth0 inet dhcp此外,Debian 还支持NetworkManager,它提供了图形化和命令行工具来管理网络设置,适用于桌面环境。更复杂的网络配置(如桥接模式等)可以通过相应的配置文件和工具进行设置。通过正确配置网络接口,可以确保 Debian 系统在不同网络环境下的稳定性和连通性。