使用 NetworkManager 成功连接到我保存的家庭网络,然后断开连接后,尽管我的无线接口显然可用,但我无法再连接。
系统信息
$ lsb_release -a
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
$ uname -a
Linux debian 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
连接之前的networking.service
$ sudo systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2020-11-26 15:54:47 GMT; 28s ago
Docs: man:interfaces(5)
Process: 2594 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
Main PID: 2594 (code=exited, status=0/SUCCESS)
成功连接到已保存的连接
$ nmcli con up home5
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
验证连接
$ nmcli con
NAME UUID TYPE DEVICE
home5 777ade6c-785a-47b3-8618-bbd9863bcf4f wifi wlp3s0
guest ef86fb9d-e6c6-4a40-9c66-3a70c011bf80 wifi --
home2 522dee75-b24e-4f9f-a8b8-e5a2d06dbd23 wifi --
Wired connection 1 1ff7e76d-a4e4-3795-9550-d084cb3cb9ff ethernet --
$ nmcli -p device show wlp3s0
===============================================================================
Device details (wlp3s0)
===============================================================================
GENERAL.DEVICE: wlp3s0
-------------------------------------------------------------------------------
GENERAL.TYPE: wifi
-------------------------------------------------------------------------------
GENERAL.HWADDR: XX:XX:XX:XX:XX:XX
-------------------------------------------------------------------------------
GENERAL.MTU: 1500
-------------------------------------------------------------------------------
GENERAL.STATE: 100 (connected)
-------------------------------------------------------------------------------
GENERAL.CONNECTION: home5
-------------------------------------------------------------------------------
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
-------------------------------------------------------------------------------
IP4.ADDRESS[1]: 192.168.1.107/24
IP4.GATEWAY: 192.168.1.1
IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 600
IP4.ROUTE[2]: dst = XXX.XXX.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.ROUTE[3]: dst = XXX.XXX.1.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[4]: dst = XXX.X.XXX.179/32, nh = 192.168.1.1, mt = 0
IP4.DNS[1]: 84.200.69.80
-------------------------------------------------------------------------------
IP6.ADDRESS[1]: XXXX::XXXX:XXXX:XXXX:XXXX/XX
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = ff00::/8, nh = ::, mt = 256, table=255
IP6.ROUTE[2]: dst = fe80::/64, nh = ::, mt = 256
-------------------------------------------------------------------------------
断开
$ nmcli con down home5
Connection 'home5' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
$ sudo dmesg
[ 364.051145] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[ 425.375721] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[ 426.574527] wlp3s0: authenticate with XX:XX:XX:XX:XX:XX
[ 426.582082] wlp3s0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
[ 426.583540] wlp3s0: authenticated
[ 426.587829] wlp3s0: associate with XX:XX:XX:XX:XX:XX (try 1/3)
[ 426.588766] wlp3s0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x11 status=0 aid=3)
[ 426.590296] wlp3s0: associated
[ 426.634436] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready
[ 886.307938] wlp3s0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (Reason: 3=DEAUTH_LEAVING)
[ 886.324494] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[ 889.353844] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[ 889.743616] e1000e: enp0s25 NIC Link is Down
[ 889.957723] IPv6: ADDRCONF(NETDEV_UP): enp0s25: link is not ready
尝试重新连接
$ nmcli con up home5
Error: Connection activation failed: No suitable device found for this connection (device wlp3s0 not available because device is not available).
答案1
我对类似问题做了一些进一步的研究并注意到世界文化中心已知会干扰 NetworkManager。我已经卸载了 wicd,因为我以前使用它。然而,wicd-gtk和wicd 守护进程仍然闲逛。
通过运行以下命令完全删除“wicd*”后,我能够使用 nmcli 按预期连接/断开/重新连接到我的网络。
sudo dpkg -r wicd-gtk && sudo dpkg -P wicd-gtk
sudo dpkg -r wicd-daemon && sudo dpkg -P wicd-daemon