LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-17-2020, 02:29 AM   #1
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,807

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
What Is Preferred Runlevel 3 WiFi Connect Utility?


Greetz
I have a test partition for Current, actually more than one, but one is testing for slackpkg as well. Maybe I'm mistaken but I suppose such an update/upgrade process is best served outside of X. So I'd like to connect via CLI which I haven't done since Slackware required manual config of modems and running good ol' BitchX way back in the day.

Ideally I'd like to use "nmcli" so I could keep /etc/rc.d/rc.networkmanager active (works fine in X) but after messing about with nmcli, wpa_supplicant, wpa_passphrase, ifconfig, iwlist, and iwconfig and reading lots of manpages yet still getting errors, I decided to try the older, simpler wpa_cli outlined in a Slackware doc.

The problem is that even when I edit the /etc/wpa_supplicant.conf exactly as shown in the "update_config=1" preparation stage and run the following, I get

Code:
wpa_supplicant -B -iwlan0 -Dwext -c/etc/wpa_supplicant.conf
(results)
ioctl[SIOCSIWENCODEEXT]: Invalid Argument
and I can't seem to find out why.

I'm also running into weirdness with driver selection for wpa_supplicant since wext seems to be really old, not preferred in the man pages (n180211 is said to be better) , but apparently wext is preferred by many users. I'd like to know why none of these utilities seem able to just use the kernel module, but it's likely best to discuss that later.

So, everything works splendidly in X, what is the preferred and simplest way to connect in Runlevel 3? There is too much data online with both contradictions and age working against them so even if someone just points me to a doc that is the current method/syntax I think I'm good.

If it matters, my wifi is an Intel onboard wifi 6 2x2 AX201 with an external antenna.

Last edited by enorbet; 12-17-2020 at 02:35 AM.
 
Old 12-17-2020, 03:10 AM   #2
MDKDIO
Member
 
Registered: Mar 2004
Location: Sweden
Distribution: Slackware 15
Posts: 521

Rep: Reputation: 187Reputation: 187
If you type nmcli dev status
And IF that is givingn any info related to your Wi-Fi card, type
nmcli connection

If still ok, is this command showing anything?

nmcli device list

Something to get you started.
 
Old 12-17-2020, 04:34 AM   #3
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Essentially to set up wifi connection with networkmanger in virtual console I use nmtui tool. It works fine. If for some reason it fails I disable networkmanager completely - kill daemon and chmod -x /etc/rc.d/rc.networkmanager to disable service. Then ifconfig wlanx up, iwconfig wlanx essid, wpa_supplicant -Dwext -i wlanx -c /etc/wpa_supplicant.conf, there is debug option which can give a lot of information for wpa_supplicant it is -d at the end. Last time I got issue user named network with leading space (!) - it was terrible for me to figure out what's going on - finally I found with debug option for wpa_supplicant. Be sure there is no another instance of wpa_supplicant running - can be artifact left by networkmanager.
 
3 members found this post helpful.
Old 12-17-2020, 05:20 AM   #4
MDKDIO
Member
 
Registered: Mar 2004
Location: Sweden
Distribution: Slackware 15
Posts: 521

Rep: Reputation: 187Reputation: 187
Now I'm able to do this on a computer (was on the phone earlier)...

After login, type nmcli dev status
In my case it lists wlan0 wifi disconnected
eth0 ethernet unavailable

Now type, nmcli n
Here I get enabled as result

Now type nmcli a
You should be asked for password, in my case it is trying to connect to my last used connection. Type password
Here, nothing happens (hangs kind of), hit ctrl+c works here. Now type nmcli
It should show info like:
wlan0: connected to <connection-name>
And info rel to the connection (ip adress etc)

Hope that helps
 
2 members found this post helpful.
Old 12-17-2020, 06:42 AM   #5
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
I use nmtui even if it looks terrible.

Will have to work on it since wicd-curses is dead.
 
Old 12-17-2020, 10:48 AM   #6
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Rep: Reputation: 33
What about just using the traditional slackware rc-scripts in /etc/rc.d/? Make sure that your network config is in /etc/wpa_supplicant.conf, that the rest is configured in /etc/rc.d/rc.inet1.conf. Probably no need even to touch rc.wireless.conf...
 
Old 12-17-2020, 12:28 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I always connect to my wifi using the traditional scripts that PJBrs mentioned.

I edit my /etc/rc.d/rc.inet1.conf to have the following:

Code:
IFNAME[4]="wlan0"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
Then I ensure my network is added to /etc/wpa_supplicant.conf via wpa_passphrase:

Code:
wpa_passphrase $YOUR_SSID $YOUR_PASSPHRASE >> /etc/wpa_supplicant.conf
My /etc/wpa_supplicant.conf looks like:

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
network={
        ssid="not-my-ssid"
        #psk="not-my-psk"
        psk=fb1269232a9037f5ced9695607c5d10c34439b5617a4c94a82f2695fc498c664
}
Then you should be able to simply restart your inet1 service:

Code:
/etc/rc.d/rc.inet1 wlan0_restart
Or you can connect using wpa_supplicant manually using:

Code:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
And then get a dhcp address:

Code:
dhcpcd wlan0
 
3 members found this post helpful.
Old 12-17-2020, 01:04 PM   #8
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,807

Original Poster
Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
Thanks guys. I know about setting up wireless on /etc/rc.d/rc.inet1.conf but I'm hoping to use nmcli, or something associated (I didn't know about nmtui) , so I can use a Runlevel 3 connection on demand occasionally without upsetting my normal NetworkManager utilization and configuration in X. It's likely overkill since I live in a very rural area but I just can't shed my network security training and like the fact that KWallet protects wifi connections with a PGP based encryption, so I want to keep it.

There are some really good suggestions here and I will try them today.
 
Old 12-17-2020, 01:55 PM   #9
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,807

Original Poster
Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
------ UPDATE ------ SUCCESS! ----------

Bingo! It seems my Invalid Argument was in wpa_supplicant.conf. Firstly I had way too many arguments like "key_mgmt", "scan_ssid=1", "proto", "pairwise", etc., and I had quotation marks around my preferred SSID. I did already generate my proper psk, so at least I got that right. Paring down and eliminating the erroneous punctuation (thanks to examples from bassmadrigal) I tried nmtui which immediately worked! So I then tried all the other suggestions and they all worked! My problem apparently was the improper syntax in wpa_supplicant.conf.

Huge thanks to all. Now all I have to do is figure out why slackpkg fails to resolve hosts even just to update gpg or find any changelogs even when uncommenting just "https://mirrors.slackware.com/slackware/slackware64-current/". Little by little....
 
Old 12-17-2020, 04:19 PM   #10
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
If you're interested in a script to temporarily connect to a wireless network via CLI, I made one for a previous thread. It heavily uses bashisms, so you would need to run it with bash, but it does allow easy connecting of a temporary network without saving any of that data to the computer.

https://github.com/bassmadrigal/scri...etup-script.sh
 
3 members found this post helpful.
Old 12-18-2020, 02:09 PM   #11
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,807

Original Poster
Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
That's a tidy script, bassmadrigal, but given your history I expected nothing less

As for my connection problems for slackpkg I finally figured out that pinging isn't the same as actually having connectivity, so for any lurkers, please be aware that even after using nmtui. we have to run "dhcpcd wlan0". or whatever your device is named.
 
Old 12-22-2020, 05:17 PM   #12
truepatriot76
Member
 
Registered: Apr 2014
Location: California, USA
Distribution: slackware64-current
Posts: 232

Rep: Reputation: 195Reputation: 195
Quote:
Originally Posted by enorbet View Post
Thanks guys. I know about setting up wireless on /etc/rc.d/rc.inet1.conf but I'm hoping to use nmcli, or something associated (I didn't know about nmtui) , so I can use a Runlevel 3 connection on demand occasionally without upsetting my normal NetworkManager utilization and configuration in X. It's likely overkill since I live in a very rural area but I just can't shed my network security training and like the fact that KWallet protects wifi connections with a PGP based encryption, so I want to keep it.

There are some really good suggestions here and I will try them today.
With networkmanager, you could add the following to /etc/rc.d/rc.local

Code:
nmcli connection up {name of connection}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the difference between runlevel 2 and runlevel 5 in Debian? davidas Linux - Newbie 2 01-05-2012 01:10 PM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie SUSE / openSUSE 1 01-18-2006 09:15 AM
X does not start in Runlevel 4, but i Runlevel 3 Rabon Linux - General 3 11-18-2003 06:24 AM
Preferred RunLevel Crashed_Again Linux - General 7 02-16-2003 12:27 AM
is runlevel 3 preferred to 5 bdp Linux - General 2 01-22-2003 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration