Linux notes and info.
Simple wireless connection using dhcpcd or dhclient and wpa_supplicant. Modify the conf file with your AP details.
Use "ip link show" to see what your interface is called.
It doesn't work (with dhcpcd) if Network Manager is installed. It is sort of adapted from the Arch Linux wifi menu program and the Arch wireless wiki.
It worked in Artix Linux, Void Linux and Devuan.
File: /usr/local/bin/wlp7-on
#!/bin/bash
ip link set wlp7s0 up
wpa_supplicant -B -P /run/wpa_supplicant_wlp7s0.pid -i wlp7s0 -D nl80211,wext \
-c /opt/wireless/wpa_supplicant_wlp7s0.conf
sleep 1
dhcpcd -4 -t 0 -K wlp7s0
# or with dhclient, dhclient.conf can be an empty file, and dhclient works better than dhcpcd with default configuration
#dhclient -v -cf /opt/wireless/dhclient.conf wlp7s0
File: /usr/local/bin/wlp7-off
#!/bin/bash
dhcpcd -4 -x wlp7s0
# for dhclient use:
#dhclient -x wlp7s0
wpa_cli -i wlp7s0 -p /run/wpa_supplicant terminate
ip link set wlp7s0 down
rm -f /run/wpa_supplicant/wlp7s0
File: /opt/wireless/wpa_supplicant_wlp7s0.conf
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
network={
proto=RSN WPA
psk="wireless access point password"
ssid="name of AP"
}
Use "ip link show" to see what your interface is called.
It doesn't work (with dhcpcd) if Network Manager is installed. It is sort of adapted from the Arch Linux wifi menu program and the Arch wireless wiki.
It worked in Artix Linux, Void Linux and Devuan.
File: /usr/local/bin/wlp7-on
#!/bin/bash
ip link set wlp7s0 up
wpa_supplicant -B -P /run/wpa_supplicant_wlp7s0.pid -i wlp7s0 -D nl80211,wext \
-c /opt/wireless/wpa_supplicant_wlp7s0.conf
sleep 1
dhcpcd -4 -t 0 -K wlp7s0
# or with dhclient, dhclient.conf can be an empty file, and dhclient works better than dhcpcd with default configuration
#dhclient -v -cf /opt/wireless/dhclient.conf wlp7s0
File: /usr/local/bin/wlp7-off
#!/bin/bash
dhcpcd -4 -x wlp7s0
# for dhclient use:
#dhclient -x wlp7s0
wpa_cli -i wlp7s0 -p /run/wpa_supplicant terminate
ip link set wlp7s0 down
rm -f /run/wpa_supplicant/wlp7s0
File: /opt/wireless/wpa_supplicant_wlp7s0.conf
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
network={
proto=RSN WPA
psk="wireless access point password"
ssid="name of AP"
}