如何使用命令行工具重新连接 wifi

如何使用命令行工具重新连接 wifi
root@x# dmesg | grep rename
[    3.127628] r8169 0000:01:00.0 enp1s0: renamed from eth0
[    5.302161] r8188eu 1-1:1.0 wlx10feed2673c7: renamed from wlan0

工作时间=wlx10feed2673c7

root@x# cat /etc/wpa_supplicant/wpa_supplicant.conf
country=au
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="hi-fi"
        psk=#########
}

使用cmd连接

root@x# wpa_supplicant -B -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf -i $wf


root@x# 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).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

iface eth0 inet dhcp

auto wlx10feed2673c7
allow-hotplug wlx10feed2673c7
iface wlx10feed2673c7 inet dhcp

我的 /etc/network/interfaces 是否正确?连接 wifi 和“将来自动连接”的标准流程是什么(例如,重新启动或 wifi 超出范围,然后再次进入范围)???

或者我必须按原样使用?

auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet dhcp

wifi 连接正常,但我希望在启动时、信号在范围内时自动连接

相关内容