问题
如果配置了多个适配器,如何配置ubuntu,以便在启动时不会收到“正在等待网络配置...”消息?
事实
我在Virtual Box和VM-Ware Workstation中都拥有未改动的Ubuntu。
我的/etc/network/interfaces
文件没有被修改,我已经激活了一个Nat适配器以使用主机系统的真实网卡。
扣除
我发现接口文件只需要一个网关条目,并且给出了低谷。
auto eth0
iface eth0 inet dhcp
。
因此,这是提供网关信息的第一个网络适配器的条目,因此第二个配置不需要名为
gateway 192.168.1.1
。
对我来说,这意味着第二项必须看起来像这样:
address 192.168.217.131
取决于路由器告诉您的信息(通过dcp配置的接口的网络地址),第二行是网络掩码。在通常情况下,这是
netmask 255.255.255
。
因此,整个`/ etc / network / interfaces'文件看起来像这样:
#This file describe the network interfaces available on your system
#and how to activate them. For more information see interfaces(5).
#The loopack network interface
auto lo
iface lo inet loopback
#The primary network interface
# ethernet 0
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.217.131
netmask 255.255.255
#No need for gateway here because this is already provided by the dhcp entry.
在此示例中,我采用了Ubuntu的^ server(基本Ubuntu服务器)程序包提供的IP地址192.168.217.130,并将其增加了一个。
现在,我重新启动Ubuntu,并收到消息Waiting for network Configuration...
,其中Ubuntu尝试等待大约2分钟的网络连接。
我在Virtual Box上也有过。
有两件事要知道
如上所述,您的网络中不需要带有dhcp服务器的第二个网关,因为网关条目是从那里生成的。
添加主机专用适配器后,您必须从Windows主机复制ip地址。
迄今为止。
这是带有一个附加适配器的仅主机连接的示例配置:
auto eth1
iface eth1 inet static
address 192.168.253.128
netmask 255.255.255.0
network 192.168.253.1
broadcast 192.168.253.255
网络线路的第三个块取决于您的IP。主机和来宾之间的网络通信需要广播线路。这是与网络协议有关的事情。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句