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

Stü*_*cke 39 networking

我搞砸了我的网络配置。任何人都可以帮助我并复制默认值/etc/network/interfaces吗?

pth*_*heo 36

对于带有 dhcp 的 eth0:

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

# The primary network interface
iface eth0 inet dhcp
Run Code Online (Sandbox Code Playgroud)

对于 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
Run Code Online (Sandbox Code Playgroud)

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


Wol*_* F. 12

我的看起来像:

auto lo
iface lo inet loopback
Run Code Online (Sandbox Code Playgroud)


小智 6

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

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
Run Code Online (Sandbox Code Playgroud)