eth0 未自动配置

Dav*_*rks 7 networking ubuntu

当我启动一个 ubuntu 12.10 实例时,eth0 没有被配置。

davidparks21@MySqlDB:~$ cat /run/network/ifstate
lo=lo
Run Code Online (Sandbox Code Playgroud)

当我手动编辑ifstate,添加eth0=eth0service restart networkingeth0得到正确的配置,我们都高兴。

但是重新启动,我失去了配置,必须手动编辑ifstate并再次添加它并重新启动网络。

我在这里可能缺少什么配置?


root@prodweb1:~# cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
 address 10.1.3.10
 netmask 255.255.0.0
 broadcast 10.1.255.255
 gateway 10.1.0.1
 dns-nameservers 8.8.8.8
 dns-nameservers 8.8.4.4
Run Code Online (Sandbox Code Playgroud)

小智 2

要在重新启动时启动,eth0您需要添加一个条目,/etc/network/interfaces如下所示eth0

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