当我启用无线功能并插入以太网电缆时,即使无线和有线连接通过同一个网络,无线连接仍保持活动状态。
我知道这个问题它告诉如何禁用它,但我想知道为什么这不是 Ubuntu 的默认行为,或者为什么 Ubuntu 在其设置中没有允许这样做的选项。
我能想到保持无线连接处于活动状态的唯一原因是能够访问该网络上的其他 LAN 设备,但当无线和有线连接处于同一网络时,这种说法并不成立。另一个原因可能是您不会在拔下以太网时浪费宝贵的时间,但我怀疑这是一个有效的论点,因为移除以太网通常意味着您要搬到另一个地方,而大多数人在搬家时不会使用他们的电脑。
答案1
简单来说,你的有线网卡和无线网卡是两个不同的卡。因此,你有两种不同的可能的连接。因为它能连接到它们两个,它不会假设您想要任何其他方式。
至于为什么要使用两种网络连接,有以下几个原因:
- 网络稳定性 - 只要两个设备不同时断开连接,当其中一个设备断开连接时,连接不会中断。这还可以让您避免因某种原因需要互联网访问的设备断开连接(即使您没有主动打字或上网,也并不意味着您在传输过程中无法使用互联网)。
- 负载平衡 - 高级用法可能能够允许通过有线连接进行游戏等,以及通过无线进行下载,除非它们对公共连接点(路由器,传入连接等)造成负担,否则两者都不会变慢。
- 使用 VPN 连接时保持 Internet 访问 - VPN 连接通常会切断您对 Internet 的访问。解决此问题的一种方法是简单地将一个连接用于 VPN,另一个连接用于 Internet。
答案2
我同意@Shauna,但是,如果您想设置您的系统,使得有线和无线永远不会同时打开,并且如果您熟悉命令行,请阅读man 5 interfaces
,尤其是:
IFACE OPTIONS
The following "command" options are available for every family and method. Each of these options can be given multiple times in a single stanza, in which case the
commands are executed in the order in which they appear in the stanza. (You can ensure a command never fails by suffixing them with "|| true".)
pre-up command
Run command before bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured, prints an error
message, and exits with status 0. This behavior may change in the future.
up command
post-up command
Run command after bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured (even though it
has really been configured), prints an error message, and exits with status 0. This behavior may change in the future.
down command
pre-down command
Run command before taking the interface down. If this command fails then ifdown aborts, marks the interface as deconfigured (even though it has not really
been deconfigured), and exits with status 0. This behavior may change in the future.
post-down command
Run command after taking the interface down. If this command fails then ifdown aborts, marks the interface as deconfigured, and exits with status 0. This
behavior may change in the future.
There exists for each of the above mentioned options a directory /etc/network/if-<option>.d/ the scripts in which are run (with no arguments) using run-parts(8)
after the option itself has been processed. Please note that as post-up and pre-down are aliases, no files in the corresponding directories are processed. Please
use if-up.d and if-down.d directories instead.