更改 WIFI 熱點設備

更改 WIFI 熱點設備

我安裝了兩個 WiFi 轉接器,我希望將第二個轉接器用於我的行動熱點,而不是第一個轉接器。我該怎麼做呢?我嘗試使用 nm-connection-editor 來更改設備,但是當我打開移動熱點時,它只會與第一個設備創建另一個連接。

答案1

注意:未經測試,因為我的筆記型電腦中沒有兩個 wifi 卡/適配器。

透過執行指令取得 wifi 卡/轉接器名稱lshw並尋找所需的值。

lshw我的系統中的一些內容

*-network
                description: Wireless interface
                product: Wireless 3165
                vendor: Intel Corporation
                physical id: 0
                bus info: pci@0000:02:00.0
                logical name: wlp2s0

例如,這裡第二個 Wifi 卡/轉接器的邏輯名稱是wlp2s0,我們希望將此連線用於wifi-hotspot

使用以下命令建立 Wifi 熱點連線。

nmcli device wifi hotspot ifname wlp2s0 con-name PARROT password 1234abcd

更改wlp2s0您的 wifi 卡邏輯名稱
更改PARROT您想要的任何連接名稱
更改1234abcd您想要的至少 8 個字元的密碼

若要開啟和關閉此 Wifi 熱點,請使用下列命令,並變更PARROT您的連線名稱

nmcli connection up PARROT
nmcli connection down PARROT

man nmcli

wifi hotspot [ifname ifname] [con-name name] [ssid SSID] [band {a | bg}] [channel channel]
   [password password]
       Create a Wi-Fi hotspot. The command creates a hotspot connection profile according to
       Wi-Fi device capabilities and activates it on the device. The hotspot is secured with
       WPA if device/driver supports that, otherwise WEP is used. Use connection down or
       device disconnect to stop the hotspot.

       Parameters of the hotspot can be influenced by the optional parameters:

       ifname
           what Wi-Fi device is used.

       con-name
           name of the created hotspot connection profile.

       ssid
           SSID of the hotspot.

       band
           Wi-Fi band to use.

       channel
           Wi-Fi channel to use.

       password
           password to use for the created hotspot. If not provided, nmcli will generate a
           password. The password is either WPA pre-shared key or WEP key.

相關內容