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


Answers:


33

对于带有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


1
因此,如果我的没有主网络接口,而只有iface lo inet回送,该怎么办?
IgorGanapolsky

您必须添加主行(dhcp或静态),并在上面添加以下行
ptheo 2015年

如果我不添加“网络”和“广播”条目怎么办?将默认设置为合理值吗?
JohnyTex

9

我的看起来像:

auto lo
iface lo inet loopback

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.