In the building where I am living is having a WiFi with two channels and same SSID. Whenever I connect to the WiFi, it always connects to the 2.4GHz band but I want to connect to 5GHz band. I have already tried this but all in vain. Also, I have tried linSSID app but it isn't even launching.
I am using Ubuntu 18.04 LTS and output of lshw -C network
:
*-network
description: Wireless interface
product: Wireless 3160
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:01:00.0
logical name: wlp1s0
version: 83
serial: e4:02:9b:d2:65:c7
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-34-generic firmware=17.948900127.0 ip=172.21.126.136 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:128 memory:df100000-df101fff
Output of iwlist chan
:
wlp1s0 26 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 36 : 5.18 GHz
Channel 40 : 5.2 GHz
Channel 44 : 5.22 GHz
Channel 48 : 5.24 GHz
Channel 52 : 5.26 GHz
Channel 56 : 5.28 GHz
Channel 60 : 5.3 GHz
Channel 64 : 5.32 GHz
Channel 149 : 5.745 GHz
Channel 153 : 5.765 GHz
Channel 157 : 5.785 GHz
Channel 161 : 5.805 GHz
Channel 165 : 5.825 GHz
To confirm that your wireless card is capable of connecting to 5ghz do
iw list
and look for the portion that looks like belowTo answer your question, I am assuming the network card is capable of connecting to the 5ghz network. Using the command line interface is flexible compared to using the network manager gui. The important thing is to get the ssid and bssid of the 5ghz network you want to connect to.
This would list some values such as
Look for your desired ssid and the corresponding frequency. Now look for the BSSID that matches the desired frequency and SSID.
Next, kill network-manager and wpa_supplicant:
This may not be desirable for most people but for the purposes of your question.
Create a
wpa_supplicant.conf
:and paste the network specs of the network you are connecting to:
Replace bssid with the one of the network you are connecting to
Now start wpa_supplicant via that conf file:
After authentication flush any held ip addresses:
Request a dynamic ip (dhcp):
At this point you should be connected to the 5ghz network.
To check whether you are really connected to the 5ghz but not the 2ghz do
iw dev
and you should have a results likeThe whole procedure above works well but may not survive a reboot and is not useful if you would want to be switching between different kinds of networks.
To start initialize network manage:
Then from the network tray icon connect to your DESIRED SSID. Never mind whether it is 2.4 or 5ghz. we would do that later.
Now do:
To get the BSSID that matches the desired frequency and ssid
Next click the network manager tray icon > edit connections > double click on the DESIRED SSID to edit it as following
On wifi tab: SSID (DESIRED SSID), mode (Client), band (5), channel (enter the value you got from the scan results), bssid (enter desired bssid) device (wlp1s0), cloned mac (permanent), mtu (automatic)
Then disconnect and connect again and it should work.