Vin*_*yen 9 server wireless networking
我刚刚在我的计算机上安装了 Ubuntu 14.04 服务器,该服务器同时具有有线网络端口和 wifi 卡。我希望服务器在不可用时使用有线网络,并在不可用时使用 wifi。
原始的 /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 p4p1
iface p4p1 inet dhcp
Run Code Online (Sandbox Code Playgroud)
我关注了这篇文章并将我的文件修改为:
# 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
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <my_ssid>
wpa-psk <my_ssid_password>
# The primary network interface
auto p4p1
iface p4p1 inet dhcp
Run Code Online (Sandbox Code Playgroud)
当我重新启动 wlan0 时,我可以连接到我的 wifi,没问题。如果我在插入网线的情况下重新启动计算机,则有线和 wifi 连接都连接到我的网络,因此没有问题。但是,如果我拔掉有线连接并重新启动,我会在启动时看到消息“正在启动配置网络设备”。然后,我在系统完全启动之前看到消息“等待网络配置最多 60 秒”(因此它等待网络 120 多秒)。当计算机启动时,我的 wifi 连接已连接。
所以,我想一切正常,但是我的无头服务器需要很长时间才能完全启动。我究竟做错了什么?有没有办法解决这个启动延迟?谢谢你。
声明“auto p4p1”和“auto wlan0”要求系统自动启动两个接口。当您以分离的以太网开始并要求接口无论如何启动时,系统会跌跌撞撞:“最多等待 60 秒以进行网络配置。”
省略 'auto' 声明会更有效,但肯定不是自动的:
# 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
#auto wlan0
iface wlan0 inet dhcp
wpa-ssid <my_ssid>
wpa-psk <my_ssid_password>
# The primary network interface
#auto p4p1
iface p4p1 inet dhcp
Run Code Online (Sandbox Code Playgroud)
并根据需要手动启动任一界面:
sudo ifup -v wlan0
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7763 次 |
最近记录: |