Solved wpa_supplicant - no ip-address

Hello! I have a problem.
System: FreeBSD 12.1-STABLE
When I run a command:
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
It connects to WiFi, but system doesn't obtain ip-address, dns and etc.
My ifconfig:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
  ether e:::::f
    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
    groups: wlan
    ssid TLD channel 1 (2412 MHz 11g ht/40+) bssid 04:bf:6d:93:e8:58
    regdomain 32924 country CN indoor ecm authmode WPA2/802.11i
    privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7
    scanvalid 60 protmode CTS ampdulimit 64k ampdudensity 4 shortgi -ldpc
    wme burst roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
On router (Keenetic) it doesn't look like connected! I don't see freebsd as connected
My /etc/wpa_supplicant.conf:
Code:
fast_reauth=1
ap_scan=1
network={
ssid="TLD"
psk="pass"
priority=2
key_mgmt=WPA-PSK
proto=WPA2
pairwise=CCMP
# group=CCMP
}
There are no error in /var/log/messages. Only this:
Code:
May 22 21:01:39 freebsd_tom dhclient[13321]: send_packet: No buffer space available

But:
- to other WiFi network with similar settings connects perfectly.
- Linux Arch connects to this WiFi network "TLD" with this settings also perfectly.

What's wrong?
 
Last edited by a moderator:
My /etc/rc.conf:
Code:
ifconfig_re0="inet 192.168.0.1 netmask 255.255.255.224"
gateway_enable="YES"
hostname="freebsd_tom"
wlans_ath0="wlan0"
ifconfig_wlan0="DHCP"

dhcpd_enable="YES"
dhcpd_flags="-q"
dhcpd_conf=/usr/local/etc/dhcpd.conf
dhcpd_ifaces="re0"
...
I also try with "ifconfig_wlan0="DHCPSYNC", but it doesn't work.
Yes, I see router:
Code:
ifconfig wlan0 list scan
SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT CAPS
TLD                               04:::::58    1   54M  -86:-91   100 EP   HTCAP RSN BSSLOAD WME WPS
When I try manually run dhclient:
Code:
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
No DHCPOFFERS received.
Trying recorded lease 172.20.10.2
No working leases in persistent database - sleeping.
 
Last edited by a moderator:
Shouldn't it be "ifconfig_wlan0="WPA DHCP"?

I have never seen the option dhcp_enable before, but it might not be harmful. ;D
The handbook also recommends setting the correct region, e.g. # sysrc create_args_wlan0="country CN",
Wireless Networking
 
If you have not configured it with rc, to get IP you must give, after your wpa_supplicant , also the commando:

# dhclient wlan0
 
Have you tried ifconfig_wlan0="WPA SYNCDHCP" ?
Yes, I have:
Code:
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
No DHCPOFFERS received.
Trying recorded lease 172.20.10.2
No working leases in persistent database - sleeping.
No result. I don’t understand why it doesn’t get DHCP!! It sent DHCPREQUEST, but doesn’t get any result and why wlan0 get an 0.0.0.0 ip-address??

With other WiFi network (i.e. iPhone Hotspot, Android Hotspot) is works perfectly!
 
Last edited by a moderator:
I can believe it!!
Problem was: WiFi-router was too far from freebsd-host. When I moved it nearer everything worked fine!
Thx to all!!
 
Have you tried ifconfig_wlan0="WPA SYNCDHCP" ?

Yes, I have:
I assume you have restarted netif: service netif restart

Try with a simpler /etc/wpa_supplicant configuration ( for now, in case of ip can obtained you can add gradually the other parameters ):

Code:
network={
    ssid="myssid"
    psk="mypsk"
}
Replace "mypsk" with password.

/etc/rc.conf
Code:
wlans_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
create_args_wlan0="regdomain ROW country CN"
service netif restart

Try other DHCP settings if the above example doesn't work. After every change restart netif.

Replace "regdomain ROW country CN" with correct country settings if CN isn't. Open file /etc/regdomain.xml, search for country code and the regulatory domain.
 
Back
Top