** RESOLVED ** Issues with DHCP and WPA_supplicant

10 posts / 0 new
Last post
#1 Fri, 2018-03-23 20:04
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

Hi,

So im not to sure what's happening but i cant seem to auto connect to wifi for some reason. The wifi service gets initialized and started at boot. Below is more details.

This is my /etc/networking/interfaces:

auto lo 
iface lo inet loopback
 
auto wlan0 
iface auto wlan0 inet dhcp 

i also have the correct details in /etc/wpa_supplicant/wpa_supplicant.conf

The problem is that while wpa_supplicant is getting initialized, no dhcp request is being issued, so on every boot i have to either:

 udhcp -i  wlan0
or
 ifup wlan0
in order to be issued with a IP address.

Any help would be great.

Fri, 2018-03-23 21:34
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2016-05-01

You don't need the "auto" bit on the second line, try

auto wlan0
iface wlan0 inet dhcp

^ That works on my Alpine system.

Fri, 2018-03-23 21:42 (Reply to #2)
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

So i have edited it out and rebooted, again i can see the wpa_supplicant service running and initializing but DHCP is not started automatically.

Im not sure what is causing this?

Fri, 2018-03-23 21:48 (Reply to #3)
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2016-05-01

Try # ifdown wlan0 then # ifup wlan0

Post any errors.

As I said, I've just tried on my system and it works fine.

Fri, 2018-03-23 22:01
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

There are no errors, ifdown brings the connection down and ifup issues a DHCP request and i get an IP address.

The problem is that when i reboot, DHCP is supposed to start, so i can get an IP address and start using the network. but when i boot, wpa_supplicant get's initialized and i have to run the dhcp command, when i shouldn't.

I'll link my config files:
/etc/network/interfaces

auto lo
iface lo inet loopback
 
auto wlan0
iface wlan0 inet dhcp
	hostname peach

/etc/wpa_supplicant/wpa_supplicant.conf
# reading passphrase from stdin
network={
	ssid="AndroidAP"
	#psk="123456789"
	psk=2a336741dae590f54e1c7924c940559a848840030ee965aaa178023ab490023b
}

Fri, 2018-03-23 22:09 (Reply to #5)
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2016-05-01

Check the output of rc-update|grep wpa, it should be started at "boot", is that the case?

Fri, 2018-03-23 22:17 (Reply to #6)
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

Yeah it's set to start at boot

peach:~# rc-update|grep wpa
       wpa_supplicant | boot

Fri, 2018-03-23 22:32 (Reply to #7)
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2016-05-01

Check /var/log/{messages,dmesg} for any errors.

Fri, 2018-03-23 22:40
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

It's actually quite confusing. I can see the wpa_supplicant service initialize, authenticate then associate it's self with the network, but there is no mention of dhcp at boot time, when looking at logs.

Fri, 2018-03-23 22:56
Blossom
  • Blossom's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2018-03-23

** update **

Issue resolved

i did not have the networking service set to the boot runlevel.

once you  rc-update add networking boot it should work.

Thank you headonsticks for all your help mate!

Log in or register to post comments