默认的 /etc/network/interfaces 是什么?

默认的 /etc/network/interfaces 是什么?

我搞乱了我的网络配置。有人能帮我复制默认设置吗/etc/network/interfaces

答案1

对于使用 dhcp 的 eth0:

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet dhcp

对于 eth0 静态:

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet static
    address 192.168.10.33
    netmask 255.255.255.0
    broadcast 192.168.10.255
    network 192.168.10.0
    gateway 192.168.10.254 
dns-nameservers 192.168.10.254

关联: http://www.iasptk.com/ubuntu/20202-ubuntu-server-networking-configuration-dhcp-address-static-ip-address-second-ip-address-or-virtual-ip-address

答案2

我的样子如下:

auto lo
iface lo inet loopback

答案3

Debian 网络配置页面,如果你只是使用 DHCP,那么你所需要的只是:

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

答案4

以下是的默认内容/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback

相关内容