Johnny_C
Posts: 3
Joined: Mon Jun 11, 2018 11:59 pm

Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 12:13 am

I am working on a Raspian Acces point using Hostapd and Dnsmasq.
I followed the exact steps of the official tutorial:https://www.raspberrypi.org/documentati ... s-point.md.
So my config on both services is:
Hostapd.conf:

Code: Select all

interface=wlan0 
driver=nl80211
ssid=PiNetwork
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Password
wpa_key_mgmt=WPA-PSK
wpa_pairwise-TKIP
rns_pairwise=CCMP
Dnsmasq:

Code: Select all

interface=wlan0     
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
The SSID shows on my wireless devices, but when i try to connect it does's assign a IP adress to the device.
When trying to connect and using sudo Service Dnsmasq status, it gives the:

Code: Select all

no address range available for DHCP request via wlan0
I found this strange as i have correctly provide the range in the Dnsmasq.conf.
I hope anyone can help me with this problem.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 2:01 am

Froma a terminal, run

Code: Select all

ifconfig
What IP address and netmask is assigned to wlan0?

Johnny_C
Posts: 3
Joined: Mon Jun 11, 2018 11:59 pm

Re: Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 7:30 am

it returns: inet 192.168.1.107 netmask 255.255.255.0 broadcast 192.168.1.255.
And it does show up when using ifconfig, but when using service dnsmasq status, it give a warning telling me that wlan0 does not excist.
mabye thats being caused with both wlan0 and wlan1 being connected to the same wifi network

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 8:12 am

If you followed the access point setup, wlan0 should have an IP of 192.168.4.1/24.

If you are using two wifi devices, you must split the wpa_supplicant.conf files.
/etc/wpa_supplicant/wpa_supplicant/wpa_supplicant-wlan0.conf
and
/etc/wpa_supplicant/wpa_supplicant/wpa_supplicant-wlan1.conf
There must be no network section in the original wpa_supplicant.conf or wpa_supplicant-wlan0.conf.

Johnny_C
Posts: 3
Joined: Mon Jun 11, 2018 11:59 pm

Re: Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 9:19 am

Oke, i cant find the directory of Wpa_supplicant.conf. But the error has changed.
Now it says that wlan0 doest have a adress. i rechecked the Dhcpcd config and the static ip_adress is provided.
With the only thing added to the end of the config:

Code: Select all

interface wlan0
static ip_adress=192.168.4.1/24
Also, the error messages keep changing after a reboot.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Raspian AP. cant configure IP with dnsmasq.

Tue Jun 12, 2018 11:26 am

I gave that to you.
/etc/wpa_supplicant/wpa_supplicant.conf

You misspelled address. It should be:

Code: Select all

interface wlan0
static ip_address=192.168.4.1/24

Return to “Troubleshooting”