Command To Connect to Default Wifi?
Command To Connect to Default Wifi?
Hi
How to connect to the default wifi connection using command line without using NetworkManager?
NetworkManager and nm-applet run continually, and consume RAM. I´m trying to reduce Porteus footprint.
THX
How to connect to the default wifi connection using command line without using NetworkManager?
NetworkManager and nm-applet run continually, and consume RAM. I´m trying to reduce Porteus footprint.
THX
Last edited by johnywhy on 01 Sep 2018, 05:35, edited 3 times in total.
Command To Connect to Default Wifi?
nope. that's the normal way to do it.
i want to call lower-level functions. Maybe the same functions nm-applet calls.
i want to call lower-level functions. Maybe the same functions nm-applet calls.
Command To Connect to Default Wifi?
This works for me:
drop to root
# su
it seems NetworkManager locks the device, so i have to kill NetworkManager and nm-applet processes before connecting:
# kill `pgrep NetworkManager`
# kill `pgrep nm-applet`
gentler way is:
# /etc/rc.d/networkmanager stop
(equivalent on non-porteus systemd OS's: # systemctl stop NetworkManager)
Assume wireless device is called wlan0:
To connect:
1. turn on wireless
# ifconfig wlan0 up
2. connect to named no-password connection
# iwconfig wlan0 essid [ConnectionName]
3. flush old ip address
# ip addr flush dev wlan0
4. get dhcp ip-address
# dhclient wlan0
-----
Connect to WPA/WEP with password:
(i have not tried these)
connect to named connection with WEP password
# iwconfig wlan0 essid ConnectionName key s:MyPassword
connect to named connection with WPA/WPA2 password, see post below.
-----
More useful commands:
disable network manager at boot:
# chmod -x /etc/rc.d/rc.networkmanager
(equivalent on non-porteus systemd OS's: # systemctl disable NetworkManager)
show network devices, to get name of your wireless device (eg wlan0):
# iwconfig
show state of wireless (connected, not connected, off):
# iwconfig wlan0
list available wifi hotspots:
# iwlist wlan0 s | grep ESSID
see history of system wireless messages
# dmesg | grep wlan0
These commands could be wrapped up in a very simple gui. No need to run services in the background continually.
-----
awesome resource:
https://askubuntu.com/a/16588
drop to root
# su
it seems NetworkManager locks the device, so i have to kill NetworkManager and nm-applet processes before connecting:
# kill `pgrep NetworkManager`
# kill `pgrep nm-applet`
gentler way is:
# /etc/rc.d/networkmanager stop
(equivalent on non-porteus systemd OS's: # systemctl stop NetworkManager)
Assume wireless device is called wlan0:
To connect:
1. turn on wireless
# ifconfig wlan0 up
2. connect to named no-password connection
# iwconfig wlan0 essid [ConnectionName]
3. flush old ip address
# ip addr flush dev wlan0
4. get dhcp ip-address
# dhclient wlan0
-----
Connect to WPA/WEP with password:
(i have not tried these)
connect to named connection with WEP password
# iwconfig wlan0 essid ConnectionName key s:MyPassword
connect to named connection with WPA/WPA2 password, see post below.
-----
More useful commands:
disable network manager at boot:
# chmod -x /etc/rc.d/rc.networkmanager
(equivalent on non-porteus systemd OS's: # systemctl disable NetworkManager)
show network devices, to get name of your wireless device (eg wlan0):
# iwconfig
show state of wireless (connected, not connected, off):
# iwconfig wlan0
list available wifi hotspots:
# iwlist wlan0 s | grep ESSID
see history of system wireless messages
# dmesg | grep wlan0
These commands could be wrapped up in a very simple gui. No need to run services in the background continually.
-----
awesome resource:
https://askubuntu.com/a/16588
Last edited by johnywhy on 01 Sep 2018, 15:10, edited 19 times in total.
Command To Connect to Default Wifi?
there surely exists a simple iwconfig GUI that will run on Porteus.
anybody know of one?
I´ve found these, but no luck running them yet:
apradar-0.52-1.i586.rpm http://apradar.sourceforge.net
gtkwifi-1.10.tar.bz2 https://sourceforge.net/projects/gtkwifi/
gwireless_applet-0.8.tar.gz https://sourceforge.net/projects/gwifiapplet/
netchoose-0.2-1.i386.rpm http://www.plutospin.com/netchoose.html
wicd-1.7.3.tar.gz https://launchpad.net/wicd
wlassistant-0.5.7-i386-1.tgz https://sourceforge.net/projects/wlassistant/
Very Simple Wireless Manager https://github.com/dmelo/vswm
https://www.techrepublic.com/blog/10-th ... -in-linux/
anybody know of one?
I´ve found these, but no luck running them yet:
apradar-0.52-1.i586.rpm http://apradar.sourceforge.net
gtkwifi-1.10.tar.bz2 https://sourceforge.net/projects/gtkwifi/
gwireless_applet-0.8.tar.gz https://sourceforge.net/projects/gwifiapplet/
netchoose-0.2-1.i386.rpm http://www.plutospin.com/netchoose.html
wicd-1.7.3.tar.gz https://launchpad.net/wicd
wlassistant-0.5.7-i386-1.tgz https://sourceforge.net/projects/wlassistant/
Very Simple Wireless Manager https://github.com/dmelo/vswm
https://www.techrepublic.com/blog/10-th ... -in-linux/
Last edited by johnywhy on 31 Aug 2018, 21:42, edited 1 time in total.
-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
Command To Connect to Default Wifi?
Code: Select all
guest@porteus:~$ whereis wpa_supplicant
wpa_supplicant: /usr/sbin/wpa_supplicant /etc/wpa_supplicant.conf
Command To Connect to Default Wifi?
thx, @donald!
Command To Connect to Default Wifi?
WPA/WPA2 method (not tested on Porteus) with stored connections:
Create file wpa_supplicant.conf, describing all networks that the user wants the computer to connect to. Replace ESSID and Wi-fi passphrase with your own. The output will be piped to tee which then write to /etc/wpa_supplicant.conf file.
wpa_passphrase your-ESSID your-passphrase | sudo tee /etc/wpa_supplicant.conf
Now connect to wireless access point.
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
Obtain IP address:
dhclient wlan0
source, + how to auto-connect on boot
https://www.linuxbabe.com/command-line/ ... supplicant
very nice alternate method, using wpa command-line tool:
https://askubuntu.com/a/833894
Create file wpa_supplicant.conf, describing all networks that the user wants the computer to connect to. Replace ESSID and Wi-fi passphrase with your own. The output will be piped to tee which then write to /etc/wpa_supplicant.conf file.
wpa_passphrase your-ESSID your-passphrase | sudo tee /etc/wpa_supplicant.conf
Now connect to wireless access point.
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
Obtain IP address:
dhclient wlan0
source, + how to auto-connect on boot
https://www.linuxbabe.com/command-line/ ... supplicant
very nice alternate method, using wpa command-line tool:
https://askubuntu.com/a/833894
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Command To Connect to Default Wifi?
just pointing out: these are systemd commands that won't work with porteus

porteus(Slackware) uses sysvinit/bsd style init scripts
so:
Code: Select all
# /etc/rc.d/networkmanager stop
Code: Select all
# chmod -x /etc/rc.d/networkmanager
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Command To Connect to Default Wifi?
thx ncmprhnsbl! I updated my instructions, above.
Did you mean:
Code: Select all
rm /etc/rc.d/networkmanager
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Command To Connect to Default Wifi?
yeah, i got lazy.. ;p
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Command To Connect to Default Wifi?
i'm getting:
this gives no error:
on boot, NetworkManager isn't running 
Code: Select all
# chmod -x /etc/rc.d/networkmanager
chmod: cannot access '/etc/rc.d/networkmanager': No such file or directory
Code: Select all
# chmod -x /etc/rc.d/rc.networkmanager

Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Command To Connect to Default Wifi?
oops, yes, rc.networkmanager 

Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Command To Connect to Default Wifi?
wifi-radar gives:
Code: Select all
# wifi-radar
Traceback (most recent call last):
File "/usr/bin/wifi-radar", line 39, in <module>
import gtk
ImportError: No module named gtk
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Command To Connect to Default Wifi?
Code: Select all
guest@porteus:~$ su
Password:
root@porteus:/home/guest# wifi-radar
bash: wifi-radar: command not found
root@porteus:/home/guest# /usr/bin/wifi-radar
bash: /usr/bin/wifi-radar: No such file or directory
root@porteus:/home/guest#