If you have two working wireless wifi adapters (
wlan0, wlan1) and you only want to see the stats of one of them type (might need to put sudo before these commands and take out wlan1 to see for all):
sudo ifconfig wlan1
(this one is my TP-Link Archer T4U 3, if you only have one wifi adapter change
wlan1 to wlan0 for all the commands below)
A way to list all network interfaces type:
ls /sys/class/net
To make sure it’s up and running type:
sudo ifconfig wlan1 up
To stop it type:
sudo ifconfig wlan1 down (it needs to be up to work)
Scan for wireless networks type (I’m doing this with wlan1 because the TP-Link Archer T4U has a better and bigger antenna then my other wifi adapter. If you only have one adapter you should probably use lwan0):
sudo iwlist wlan1 scan
To see just the wireless network names (ESSIDs, that strait line is called a “pipe” it takes output from one command and puts it in another) type:
sudo iwlist wlan1 scan | grep ESSID
To connect to a wifi network type:
iwconfig wlan1 essid NETWORK_NAME key s:WIRELESS_KEY_PASSWORD
(if the password is not ascii you might have to take out “s:” after key.)
Connect to a WPA/WPA2 wifi network with wpa_supplicant:
Here is a website to help you
https://linuxcommando.blogspot.com/2...i-network.html
and a video I found on the topic of connecting to WPA/WPA2 wifi networks using wpa_supplicant.
https://www.youtube.com/watch?v=QGyHDIYlLFA
If you are connected but not getting an IP address, get one by typing:
sudo dhclient wlan1
If you want more information type
sudo iwconfig wlan1
Quick hack, if you have a nub or crappy wifi antenna, plug your USB wifi adapter into a USB extension cable and move it around to a better spot but you are better off getting an adapter with a bigger antenna. If you want to do more advance stuff including monitoring mode, make sure to read up on your wifi adapters features and find out if it’s compatible with your system
before you buy it.
Most routers have two bands 2.4GHz and 5GHz, you may want to separate your wireless adapters to other signals if you are getting slow speeds because of interference.
If you want to install graphical user interface for your Wifi adapters and Ethernet like nmtui (network-manager) it will force a change of your IP addresses (kick you off your headless connection) and you’ll have to go looking for those new IPs. Also, some commands will stop working (I had to remove it). If anyone has a suggestion of a CLI-Based GUI application for networking that wont change your settings post it here please.
If you have anything to add let me know.