You are not logged in.
Pages: 1
I'm trying to connect to a WPA2-PSK AES connection via netcfg, which I would prefer to function as the network daemon, but when connecting to the network it fails out with, "DHCP IP lease attempt failed"
This fail out happens not only with netcfg running as a daemon, but also when I attempt to execute "netcfg [profile]" as well as executing "netcfg2 [profile]"
Below I've included the network profile I'm attempting to load from /etc/network.d. My ESSID is a simple all letters string with mixed upper and lower case letters and my key is a simple 11 letter string with no special characters.
Thank you in advance for any help!
CONNECTION='wireless'
DESCRIPTION='Home network'
INTERFACE='wlan0'
SECURITY='wpa'
ESSID='[ESSID]'
KEY='[key]'
IP='dhcp'
Offline
How did you generate the key?
Offline
I use wpa_supplicant with netcfg. See following for more info. To generate the key, you need to use wpa_passphrase as described in the link.
Offline
I'm using WPA2-Personal. My files are the like the next:
wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
network={
ssid="mywireless"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk=#######
}
And then use wireless-wpa-config (in /etc/network.d/examples/) as base to create a file to use with netcfg in /etc/network.d/
HomeNetwork
CONNECTION='wireless'
DESCRIPTION='A wpa_supplicant configuration based wireless connection'
INTERFACE='wlan0'
SECURITY='wpa-config'
WPA_CONF='/etc/wpa_supplicant.conf'
IP='dhcp'
And finally use netcfg in terminal
netcfg HomeNetwork
I think all is in the archwiki.
Last edited by Alber (2012-03-15 10:09:21)
Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.
Offline
Can you establish your WiFi connection manually? Does it work properly then?
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
So I've managed to narrow down my problem. My issue is that dhcpcd was not running at the time I was attempting to connect. Simply starting dhcpcd and then attempting to connect yields success. To answer all the questions about my wpa_supplicant.conf, I did successfully connect to the network before having this problem with the default network daemon using wpa_supplicant (although I had to manually activate dhcpcd each time) and did attempt to connect through net cfg with a wpa_supplicant based profile. Now that I identified this problem however, I cannot get dhcpcd to start at boot, even when adding it to my daemons array (and yes, I added it to the daemons array prior to net-profiles).
Offline
So I've managed to narrow down my problem. My issue is that dhcpcd was not running at the time I was attempting to connect. Simply starting dhcpcd and then attempting to connect yields success. To answer all the questions about my wpa_supplicant.conf, I did successfully connect to the network before having this problem with the default network daemon using wpa_supplicant (although I had to manually activate dhcpcd each time) and did attempt to connect through net cfg with a wpa_supplicant based profile. Now that I identified this problem however, I cannot get dhcpcd to start at boot, even when adding it to my daemons array (and yes, I added it to the daemons array prior to net-profiles).
I have similar problems from time to time. What I normally do is set:
IP='static'
I allow netcfg to connect to wireless, and then follow it up with "dhcpcd wlan0" afterwards. Hopefully this works for you.
Offline
If you use net-auto-wireless, then you shouldn't need to start dhcpcd yourself (I don't have it in my daemons). Instead, it gets started by that daemon (eventually, it's a few scripts into the hierarchy) if needed - if specified in the network profile.
See here: https://wiki.archlinux.org/index.php/Ne … o-wireless
For example, here's my daemons array:
DAEMONS=(syslog-ng acpid dbus sensors @net-auto-wireless @net-auto-wired @netfs @laptop-mode @cupsd @crond @alsa @adsuck
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
Before netcfg I used:
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf -d
dhcpcd wlan0
As you tell. But now just:
netcfg HomeNetwork
I remember I had problems chosing one from /etc/network.d/examples
wireless-wpa don't work, I needed wireless-wpa-config.
But your problem could be another. I don't know.
Last edited by Alber (2012-03-16 18:04:51)
Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.
Offline
I have to say I found it far easier as well to point netcfg to wpa_supplicant rather than having the encryption part handled by netcfg itself. That also allows for more flexibility when you change your key, and it allows for easier debugging (where you'd want to authenticate, then acquire an IP).
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
If you use net-auto-wireless, then you shouldn't need to start dhcpcd yourself (I don't have it in my daemons). Instead, it gets started by that daemon (eventually, it's a few scripts into the hierarchy) if needed - if specified in the network profile.
See here: https://wiki.archlinux.org/index.php/Ne … o-wireless
For example, here's my daemons array:
DAEMONS=(syslog-ng acpid dbus sensors @net-auto-wireless @net-auto-wired @netfs @laptop-mode @cupsd @crond @alsa @adsuck
Your advice raised an interesting point. I tried starting only net-auto-wireless and removing the net-profiles daemon as you suggested, but dhcpcd would still not start. So I checked out the rc.d script for went and checked out the rc.d script for net-auto-wireless (included below) and what I found was that it doesn't start dhcpcd (Don't know whether that particular script is supposed to, but all I know is that neither netcfg or network automatically starts dhcp for me). So I added dhcpcd to the startup part of the script (where it's commented out below), and this has been so far my only working solution for starting dhcpcd at boot. Not ideal, but does the job.
. /etc/rc.conf
. /etc/rc.d/functions
. /usr/lib/network/globals
. /etc/conf.d/netcfg
if [[ ! -x /usr/sbin/wpa_actiond ]]; then
echo "Please install 'wpa_actiond' to use net-auto-wireless"
exit 1
fi
if [ -z "${WIRELESS_INTERFACE}" ]; then
echo "No interface name set. Add to /etc/conf.d/netcfg a line"
echo " WIRELESS_INTERFACE=\"your_interface\""
exit 1
fi
case "$1" in
start)
if ! ck_daemon net-auto-wireless; then
exit_stderr "net-auto-wireless has already been started: try \"/etc/rc.d/net-auto-wireless restart\""
fi
# Ensure any device renaming has occurred as intended
for daemon in "${DAEMONS[@]}"; do
if [[ "$daemon" = "${daemon#!}" && "$daemon" = "net-rename" ]]; then
if ck_daemon net-rename; then
/etc/rc.d/net-rename start
fi
fi
done
#dhcpcd
stat_busy "Starting netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}"
/usr/bin/netcfg-wpa_actiond "${WIRELESS_INTERFACE}" >/dev/null
if [ $? -eq 0 ]; then
add_daemon net-auto-wireless
stat_done
else
stat_fail
fi
;;
stop)
if ! ck_daemon net-auto-wireless; then
stat_busy "Stopping netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}"
/usr/bin/netcfg-wpa_actiond stop "${WIRELESS_INTERFACE}" >/dev/null
if [ $? -eq 0 ]; then
rm_daemon net-auto-wireless
stat_done
else
stat_fail
fi
fi
;;
restart)
"$0" stop
sleep 1
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
# vim: ft=sh ts=4 et sw=4:
Offline
I have to say I found it far easier as well to point netcfg to wpa_supplicant rather than having the encryption part handled by netcfg itself. That also allows for more flexibility when you change your key, and it allows for easier debugging (where you'd want to authenticate, then acquire an IP).
Authentication isn't my problem though. Leasing my IP address from the dhcp server is, and more particularly, that none of my network daemons will automatically start dhcpcd.
Offline
Well, you can pass DHCP options to netcfg as well. If it works manually, then the problem might lie with netcfg.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
As an example, I have the following in /etc/rc.conf
# DHCP example
interface=eth0
address=
netmask=
gateway=
interface=wlan0
address=
netmask=
broadcast=
gateway=
as per...
https://wiki.archlinux.org/index.php/Co … at_booting
I also have the following for my wireless setup:
CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection'
INTERFACE='wlan0'
SECURITY='wpa'
ESSID='myqwestxxxx'
KEY='{alot of letters and numbers}'
IP='dhcp'
# Uncomment this if your ssid is hidden
#HIDDEN=yes
DHCPCD starts when needed for me.
Offline
skanky wrote:If you use net-auto-wireless, then you shouldn't need to start dhcpcd yourself (I don't have it in my daemons). Instead, it gets started by that daemon (eventually, it's a few scripts into the hierarchy) if needed - if specified in the network profile.
See here: https://wiki.archlinux.org/index.php/Ne … o-wireless
For example, here's my daemons array:
DAEMONS=(syslog-ng acpid dbus sensors @net-auto-wireless @net-auto-wired @netfs @laptop-mode @cupsd @crond @alsa @adsuck
Your advice raised an interesting point. I tried starting only net-auto-wireless and removing the net-profiles daemon as you suggested, but dhcpcd would still not start. So I checked out the rc.d script for went and checked out the rc.d script for net-auto-wireless (included below) and what I found was that it doesn't start dhcpcd (Don't know whether that particular script is supposed to, but all I know is that neither netcfg or network automatically starts dhcp for me). So I added dhcpcd to the startup part of the script (where it's commented out below), and this has been so far my only working solution for starting dhcpcd at boot. Not ideal, but does the job.
It's /usr/bin/netcfg-wpa_actiond-action that actually starts it, and that's called form netcfg-wpa_actiond.
The relevant line is inside an if statement - so you may be able to track down the issue by tracing the relevant parameters.
However, using net-auto-wirless starts dhcpcd when I use it, so there must be something different in the set-ups.
I'm using the wireless-wpa-configsection profile definition in my netcfg set-up. When I set my machine up, only configsection was supported (I think), so there may be some issues using non configsection profiles. It's probably worth a try at the very least.
Edit: just realised David Batson isn't using configsection either, so my last bit is probably a red herring.
Last edited by skanky (2012-03-17 21:00:07)
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
Pages: 1