Connecting WiFi from the CLI

I have a really nice minimalist install of Antix linux on my old 32 bit laptop.
It only has a CLI… no WM and no DE.
How do I setup Wifi so I can add some software?

Tried several site’s advice. They all failed.
Then
I found this

The recipe that I evolved from following the above site is

#make sure the driver module is loaded
lsmod
# load it if not
modprobe ath5k
# kill any running wpa_supplicant
ps ax | grep wpa
kill 832
#bring the interface up 
ip link set wlan0 down
ip link set wlan0 up
#authorize the link
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/spa_supplicant.conf -Dnl80211,wext
#setup dhcp
dhclient wlan0

All the utilities used here were present in a minimal install from a CD.

The above assumes one has setup wpa_supplicant.conf.
Go to /etc/wpa_supplicant
and create the file wpa_supplicant.conf containing

network{
                ssid=" your wifi id"
                 psk="your key"
}

before you start.

This is obviously only one of several ways to do it. The above assumes WPA authorization. Only merit is, it worked for me.

Does anyone have a simpler method?

2 Likes

When I was running Gentoo (no GUI) on one of my spare laptops - I was using nmtui (network manager text user interface) to connect to wifi. **

I’ve also use “nmcli” on Debian (mostly Jessie) systems… it works quite well - and writes a wpa_supplicant file…

** it still has Gentoo on it - but I never boot it… I hardly ever even power up that laptop - it’s multiple boot - has Windows 10, Ubuntu 23.04, Gentoo (and something else I don’t remember).

Thanks, I did not know it existed.
I played with NetworkManager via nmcli. Got nowhere.
That is my fault, it should do it.
I could not even get the daemon to start… I forgot to mention I am using Antix with runit init system. It is configured differently to Void/runit… I have yet to master it.
When I get a graphics system going , I will be able to use the Antix gui for runit… that is easy.

This was the part I could never get right, where is the file and where is it configured? Is it a ~./ file?

1 Like

I got NetworkManager and the nm-applet to work and find my wifi but I had to run “killall dhcpcd” and replace it with NetworkManager as default.

wpa_supplicant.conf is in /etc/wpa_supplicant
If there is not one there, you create it with an editor… it needs the lines

network={
       ssid=" yours "
       psk="your key"
}

If the directory /etc/wpa_supplicant is not there you need to emerge some package…

emerge --ask net/wireless/wpa_supplicant
rc-update add wpa_supplicant default
rc-service  wpa_supplicant start

There is also /etc/conf.d/wpa_supplicant
in it I have

wpa_supplicant_args="-B -Dwext -iwlp0s20u9 -C /etc/wpa_supplicant/wpa_supplicant.conf"

That is all I have in Gentoo, except there is the wpagui package.

Yes I have the wpa_gui, could never enter anything, so gave up and emerged NetworkManager and the nm-applet!!! Will store your files away!!!
Is the -B -Dwext -iwlp0s20u9 -C different for each machine?

Only the wlp0s20u09… that is the device name of my wifi dongle.

You can find your device name with
ip addr

You need those other things installed and the config done, for it to work

1 Like