Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Thu Jul 19, 2018 7:27 pm

Hi all.
I am trying to setup my raspberry pi 2 as a hotspot.

I have tried for a total of a week to get it to work but i dont seem to get it working and i was hoping i could get some help.

I can see my RPI2 AP so it should be up and running one should think but.
My problem is as Android or Linux cant even connect.
As Windows i connect but with wrong ip configuration and no internet.

I use wlan0 as my internet connection and wlan1 as my hostapd Acces-Point

I Use Raspbian stretch and kernel 4.14.52-v7+

I use two Edimax EW-7811-Un dongle's one for wifi and one for Acces-Point

I do not want to use bridge as a way to get it to work.

Running

Code: Select all

iw list | grep AP

tells me both dongles can do AP

Here is what i have tried so far.

Code: Select all

apt-get update

apt-get install hostapd

# Configure hostapd

Code: Select all

nano /etc/default/hostapd

DAEMON_CONF="/etc/hostapd/hostapd.conf"

# The settings in use are

Code: Select all

nano /etc/hostapd/hostapd.conf

interface=wlan1			# the interface used by the AP
hw_mode=g				# g simply means 2.4GHz band
channel=12				# the channel to use
country_code=DK			# the country code
ieee80211n=1			# 802.11n support
wmm_enabled=1			# QoS support

macaddr_acl=0			# Accept all MAC addresses
ignore_broadcast_ssid=0	# Require clients to know the network name

ssid=somename			# the name of the AP
auth_algs=1				# 1=wpa, 2=wep, 3=both
wpa=2					# WPA2 only
wpa_key_mgmt=WPA-PSK  
rsn_pairwise=CCMP
wpa_passphrase=somepassword

# Start and enable hostapd

Code: Select all

systemctl start hostapd

systemctl enable hostapd

# Configure wlan1

Code: Select all

nano /etc/dhcpcd.conf

interface wlan1
static ip_address=192.168.10.1/24
denyinterfaces wlan1

# Install and Configure dnsmasq

Code: Select all

apt-get install dnsmasq

# i have tried setting the settings in

Code: Select all

/etc/dnsmasq.conf

# I have tried these different seetings first

interface=wlan1
dhcp-range=wlan1,192.168.10.10,192.168.10.200,255.255.255.0,2h 
dhcp-option=3,192.168.10.1	# our router 
dhcp-option=6,192.168.10.1	# our DNS Server 
dhcp-authoritative			# force clients to grab a new IP

# Then

interface=wlan1									# Use interface wlan1  
listen-address=192.168.10.1						# Explicitly specify the address to listen on  
bind-interfaces									# Bind to the interface to make sure we aren't sending things elsewhere  
server=192.168.1.1								# Forward DNS requests to my own router
domain-needed									# Don't forward short names  
bogus-priv										# Never forward addresses in the non-routed address spaces.  
dhcp-range=192.168.10.50,192.168.10.150,12h 	# Assign IP addresses

# And at the moment

interface=wlan1
no-dhcp-interface=wlan0
dhcp-range=192.168.10.1,192.168.10.200,255.255.255.0,24h

# I have allso tried with udhcpd
# I ofcouse stopped and disabled dnsmasq
# Then rebooted

Code: Select all

apt-get install udhcpd

nano /etc/udhcpd.conf

start           192.168.10.20   #default: 192.168.0.20
end             192.168.10.254  #default: 192.168.0.254

interface       wlan1           #default: eth0

opt     dns     192.168.1.1
option  subnet  255.255.255.0
opt     router  192.168.10.1
opt     wins    192.168.10.10
option  domain  local
option  lease   864000          # 10 days of seconds

# i have enabled ipv4 forwarding in

Code: Select all

nano /etc/sysctl.conf

# removed the # so it looks like

net.ipv4.ip_forward=1

# I have allso tried different iptables like

Code: Select all

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.1.1
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan1 -j ACCEPT

# Or

Code: Select all

iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan1 -o wlan0 -j ACCEPT

----

But i dont believe its got anything to do with iptables.
As Android or Linux it wont even connect.

When i connect from Windows (dnsmasq or udhcpd) and run ipconfig i get

Code: Select all

Wireles LAN adapter WI-FI:

	Connection-specific DNS Suffix			:
	link-local IPv6 Address				:	fe00:6c78:23eb:668a:676d%5
	Autoconfiguration IPv4 Address		:	169.254.103.109
	Default Gateway						:

# Which gives me enough info to know that i aint getting the right IP from hostapd/dnsmasq/udhcpd

# So i really cant figure out where the problem is since i have tried both dnsmasq and udhcpd.
# The info i get on the net doesnt seem to relate to my problem.

Hope anyone can help and best regards,
Darkyere

epoch1970
Posts: 2553
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Thu Jul 19, 2018 8:46 pm

Valiant effort I think, and it looks like you must have come very close to a fully working system at some times.

What would you think of removing your current configs, and apply the official how-to, from the top of the page down to the divider (stop a where where it says bridge).

That would give you what you want. The only thing you'll need to remember when reading the how-to is to replace:
- wlan0 with wlan1 (your AP interface)
- eth0 with wlan0 (your LAN link)

Else debugging your current install is certainly possible, but I feel it would take longer.

In any case:
- Currently your dhcp server doesn't seem to work; I don't know how udhcpd works, but dnsmasq fails to start when you use "bind-interfaces".
- You don't need to add a route in the Pi, it already has all the info it needs: .10.x is via wlan1, everything else is via wlan0.
- You can check that hostapd works by specifying (with windows it will be the easiest I guess) a static IP config in the client. Something like IP: 192.168.10.2, netmask 255.255.255.0, network 192.168.10.0, gateway 192.168.10.1, dns 8.8.8.8 (to keep dnsmasq out of the picture)
If you get to the wifi network, hostapd is ok. If you get to the internet, routing/iptables in the Pi is ok.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

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

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Fri Jul 20, 2018 11:39 am

I had problems getting hostapd service to run with wlan1 as the AP. I had to use wlan0 for the AP. I used this to change the interface names.
Create file /etc/udev/rules.d/72-static-name.rules

Code: Select all

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*",
ATTR{address}=="00:c0:ca:96:d8:8b", KERNEL=="w*",NAME="wlan0"

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*",
ATTR{address}=="b8:27:eb:1e:56:52", KERNEL=="w*",NAME="wlan1"
Change the mac addresses to set your AP interface as wlan0.
Reboot.

User avatar
DougieLawson
Posts: 34917
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Fri Jul 20, 2018 2:04 pm

That's the problem that "predictable network names" was trying to solve.

That would build wlx00c0ca96d88b & wlxb827eb1e5652 with no mucking about with udev rules needed. Move a dongle from one RPi to another and the wlx???????? name moves with it.

That allows me to use a single /etc/dhcpcd.conf file on every Raspberry.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 9:34 am

Hi all and Thank you for your responses.
I Wasn't home yesterday so i couldn't test even though i saw the messages on my phone.

I first tried SurferTim to use the official configuration The official how-to answer and it seems like i am getting closer.
It connects windows instantly and gives the right IP address.
But there is no internet and after about 30-60 sec it fallback to giving me

Code: Select all

Wireless LAN adapter WI-FI:

	Connection-specific DNS Suffix			:
	link-local IPv6 Address				:	fe00:6c78:23eb:668a:676d%5
	Autoconfiguration IPv4 Address		:	169.254.103.109
	Default Gateway						:       

I then tried the second answer from SurferTim (Ty you for posting again)

And changed my wlan0 to wlan1 and wlan1 to wlan0.
I ofcurse allso changed the settings in

Code: Select all

nano /etc/dhcpcd.conf
nano /etc/dnsmasq.conf
nano /etc/hostapd/hostapd.conf
mv /etc/wpa_supplicant/wpa_supplicant-wlan0.conf /etc/wpa_supplicant/wpa_supplicant-wlan1.conf

But with the same result i connect to my AP and get the right IP with no internet and 30-60 sec later it falls back to the wrong ip configuration.

I dont know if it's needed but im gonna attach some systemctl status **^** this time

Code: Select all

systemctl status dhcpcd

● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-07-21 11:08:04 CEST; 17min ago
  Process: 418 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b (code=exited, status=0/SUCCESS)
 Main PID: 435 (dhcpcd)
   CGroup: /system.slice/dhcpcd.service
           ├─435 /sbin/dhcpcd -q -b
           └─600 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant-wlan1.conf -iwlan1 -Dnl80211,wext

Jul 21 11:08:08 raspberrypi dhcpcd[435]: wlan1: soliciting a DHCP lease
Jul 21 11:08:09 raspberrypi dhcpcd[435]: wlan1: offered 192.168.1.64 from 192.168.1.1
Jul 21 11:08:09 raspberrypi dhcpcd[435]: wlan1: probing address 192.168.1.64/24
Jul 21 11:08:11 raspberrypi dhcpcd[435]: wlan0: using static address 192.168.10.1/24
Jul 21 11:08:11 raspberrypi dhcpcd[435]: wlan0: adding route to 192.168.10.0/24
Jul 21 11:08:14 raspberrypi dhcpcd[435]: wlan1: leased 192.168.1.64 for 86400 seconds
Jul 21 11:08:14 raspberrypi dhcpcd[435]: wlan1: adding route to 192.168.1.0/24
Jul 21 11:08:14 raspberrypi dhcpcd[435]: wlan1: adding default route via 192.168.1.1
Jul 21 11:08:20 raspberrypi dhcpcd[435]: wlan0: no IPv6 Routers available
Jul 21 11:08:20 raspberrypi dhcpcd[435]: wlan1: no IPv6 Routers available

Code: Select all

systemctl status dnsmasq


● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-07-21 11:08:07 CEST; 18min ago
  Process: 658 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
  Process: 565 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 504 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 642 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           └─642 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq

Jul 21 11:08:06 raspberrypi dnsmasq[642]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP
Jul 21 11:08:06 raspberrypi dnsmasq[642]: warning: interface wlan0 does not currently exist
Jul 21 11:08:06 raspberrypi dnsmasq-dhcp[642]: DHCP, IP range 192.168.10.2 -- 192.168.10.200, lease time 1d
Jul 21 11:08:06 raspberrypi dnsmasq[642]: read /etc/hosts - 5 addresses
Jul 21 11:08:07 raspberrypi dnsmasq[642]: no servers found in /run/dnsmasq/resolv.conf, will retry
Jul 21 11:08:07 raspberrypi dnsmasq[658]: Too few arguments.
Jul 21 11:08:07 raspberrypi dnsmasq[658]: Too few arguments.
Jul 21 11:08:07 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Jul 21 11:08:14 raspberrypi dnsmasq[642]: reading /run/dnsmasq/resolv.conf
Jul 21 11:08:14 raspberrypi dnsmasq[642]: using nameserver 192.168.1.1#53

Code: Select all

systemctl status hostapd

● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
   Active: active (running) since Sat 2018-07-21 11:08:07 CEST; 19min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 495 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/hostapd.service
           └─702 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Jul 21 11:08:07 raspberrypi hostapd[495]: Starting advanced IEEE 802.11 management: hostapd.
Jul 21 11:08:07 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.
Jul 21 11:13:35 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c IEEE 802.11: associated
Jul 21 11:13:36 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c RADIUS: starting accounting session 5B52F7F7-0
Jul 21 11:13:36 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c WPA: pairwise key handshake completed (RSN)
Jul 21 11:13:56 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c IEEE 802.11: disassociated
Jul 21 11:15:23 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c IEEE 802.11: associated
Jul 21 11:15:23 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c RADIUS: starting accounting session 5B52F7F7-0
Jul 21 11:15:23 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c WPA: pairwise key handshake completed (RSN)
Jul 21 11:21:20 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c WPA: group key handshake completed (RSN)

I hope it can help put some light on the subject.

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

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 12:42 pm

Did you add this to your entry in dhcpcd.conf?

Code: Select all

interface wlan0
    static ip_address=192.168.10.1/24
    nohook wpa_supplicant
Note the new addition of the nohook line.


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

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 1:29 pm

Your post shows hostapd service is working. You have a client

Code: Select all

Jul 21 11:13:35 raspberrypi hostapd[702]: wlan0: STA 00:22:fa:8d:e8:4c IEEE 802.11: associated
I would suspect either your masquerade or dns isn't working. Is your internet access totally unavailable, or just by domain name?

Edit: Check the status of dnsmasq after the client connects. It should show the IP it issued. If not, you have a problem.
Also check ifconfig to insure wlan0 still has the correct IP assignment.

Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 4:47 pm

The internet was totally inaccessible. I tried both Firefox and CMD ping 8.8.8.8

But i didn't know how to set a static IP on windows like u mentioned so i googled it just know.

And after setting

IP address: 192.168.1.8
Subnet mask: 255.255.255.0
Default gateway: 192.168.10.1

Preferred DNS server: 8.8.8.8

I can connect and got an internet connection.

If i set a static IP for Android i can allso connect and get internet there.

Know i need to know how to make these settings in either dnsmasq or dhcpcd since i dont know where such configuration would belong to.

Yet again thank you for the help. It seems like im getting there :D

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

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 5:32 pm

Darkyere wrote:
Sat Jul 21, 2018 4:47 pm
And after setting

IP address: 192.168.1.8
Subnet mask: 255.255.255.0
Default gateway: 192.168.10.1

Preferred DNS server: 8.8.8.8
Those network settings should cause the gateway to be unreachable. The gateway should be in the same localnet as the IP (192.168.1.x).

Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 5:40 pm

Sry mispelled it

And after setting

IP address: 192.168.10.8
Subnet mask: 255.255.255.0
Default gateway: 192.168.10.1

Preferred DNS server: 8.8.8.8

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

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Jul 21, 2018 7:11 pm

That is a good sign. It would appear the dns server (or servers) may be malfunctioning. If you remove the static settings, does the dnsmasq service show a dhcp request?

Code: Select all

sudo service dnsmasq status
It should show a dhcp request on wlan0.

Edit: The reason I used a plural (servers) above is in all my years of troubleshooting networks, I have on occasion found more than one dhcp server on a localnet. The way I find them is disable the dhcp service on the known dhcp server, then request a dhcp renewal on the client. If the client gets a dhcp offer or ack, there is a second server.

Code: Select all

sudo service dnsmasq stop

Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Mon Jul 23, 2018 5:48 pm

It seems like i dont get a DHCP request on dnsmasq

I connected and hostapd accepts the connection this is the output of dnsmasq after that

Code: Select all

 systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-07-23 03:02:59 CEST; 16h ago
  Process: 644 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
  Process: 542 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 487 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 638 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           └─638 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq

Jul 23 03:02:58 raspberrypi dnsmasq[638]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP
Jul 23 03:02:58 raspberrypi dnsmasq[638]: warning: interface wlan0 does not currently exist
Jul 23 03:02:58 raspberrypi dnsmasq-dhcp[638]: DHCP, IP range 192.168.10.2 -- 192.168.10.200, lease time 1d
Jul 23 03:02:59 raspberrypi dnsmasq[638]: read /etc/hosts - 5 addresses
Jul 23 03:02:59 raspberrypi dnsmasq[638]: no servers found in /run/dnsmasq/resolv.conf, will retry
Jul 23 03:02:59 raspberrypi dnsmasq[644]: Too few arguments.
Jul 23 03:02:59 raspberrypi dnsmasq[644]: Too few arguments.
Jul 23 03:02:59 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Jul 23 03:03:07 raspberrypi dnsmasq[638]: reading /run/dnsmasq/resolv.conf
Jul 23 03:03:07 raspberrypi dnsmasq[638]: using nameserver 192.168.1.1#53

I then connected without static IP and then tried to connect and it failed.
I thought it was because of

Code: Select all

Jul 23 03:02:58 raspberrypi dnsmasq[638]: warning: interface wlan0 does not currently exist

So i tried

Code: Select all

systemctl restart dnsmasq

Then reconnected without static IP with the same result no DHCP request.

Code: Select all

systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-07-23 19:31:34 CEST; 2s ago
  Process: 17672 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf (code=exited, status=0/SUCCESS)
  Process: 17734 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
  Process: 17724 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 17722 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 17733 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           └─17733 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsma

Jul 23 19:31:34 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jul 23 19:31:34 raspberrypi dnsmasq[17722]: dnsmasq: syntax check OK.
Jul 23 19:31:34 raspberrypi dnsmasq[17733]: started, version 2.76 cachesize 150
Jul 23 19:31:34 raspberrypi dnsmasq[17733]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TF
Jul 23 19:31:34 raspberrypi dnsmasq-dhcp[17733]: DHCP, IP range 192.168.10.2 -- 192.168.10.200, lease time 1d
Jul 23 19:31:34 raspberrypi dnsmasq[17733]: reading /run/dnsmasq/resolv.conf
Jul 23 19:31:34 raspberrypi dnsmasq[17733]: using nameserver 192.168.1.1#53
Jul 23 19:31:34 raspberrypi dnsmasq[17733]: read /etc/hosts - 5 addresses
Jul 23 19:31:34 raspberrypi dnsmasq[17734]: Too few arguments.
Jul 23 19:31:34 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

When i stopped dnsmasq and reconneted i still dont get an internet connection or the right IP but i connect fine to hostapd.

Do you know where to go from here ?

EDIT:
I tried installing hostapd on another PI to se what it pulled in and i got

Code: Select all

The following additional packages will be installed:
  libnl-route-3-200
The following NEW packages will be installed:
  hostapd libnl-route-3-200

Can this have anything to do with it ?

Darkyere
Posts: 12
Joined: Fri Oct 09, 2015 9:56 am

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Thu Jul 26, 2018 10:39 am

I think i finally figured it out.
The missing link or what wasnt written anywhere else.

The DHCP port wasnt open all i did was running the command

Code: Select all

ufw allow 67

And know i get IP and Internet connection.
Extremly slow but internet nonetheless.

I think my problem is solved thank you for your time SurferTim ill return if it was only a momentarely fix.

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Mon Mar 11, 2019 6:17 pm

Hi Darkyere,

Thank you for your topic. I'm trying to do exactly the same set. I have Raspbian Stretch and kernel 4.14.98-v7+ and two Edimax EW-7811-Un dongles. I've been trying to follow your steps.
The very first error I have is when run 'sudo systemctl start hostapd' I got 'Failed to start hostapd.service: Unit hostapd.service is masked.'
If I try start it manually 'sudo hostapd -d /etc/hostapd/hostapd.conf' the output is

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
Line 2: unknown hw_mode 'g # g simply means 2.4GHz band'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
hostapd_init: free iface 0xd94cf8
Failed to initialize interface

Can you please help me with that?
Thank you.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5581
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Mon Mar 11, 2019 6:44 pm

deli13 wrote: I got 'Failed to start hostapd.service: Unit hostapd.service is masked.'

Code: Select all

sudo systemctl unmask hostapd
sudo systemctl enable hostapd
deli13 wrote:Line 2: unknown hw_mode 'g # g simply means 2.4GHz band'
You seem to have a stray character there. it says 'g... note the ' character

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Tue Mar 12, 2019 5:51 pm

@ShiftPlusOne thank you for your answer.

Now I have the following

[email protected]:~ $ sudo systemctl start hostapd
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
[email protected]:~ $ systemctl status hostapd.service
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2019-03-12 17:33:16 GMT; 45ms ago
Process: 8964 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)

Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Control process exited, code=exited status=1
Mar 12 17:33:16 DeliPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Unit entered failed state.
Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Failed with result 'exit-code'.

I'm sorry if my next question look weak, but...
I'm going to have a business trip and I would really like to have my Raspberry ready for a hotel WiFi sharing. So, would Mr. Darkyere (or anyone else) be so kind to share image file of working set which is similar to mine. I would be so grateful.
I'm not lazy, I really enjoy playing with my Raspberry. But I don't have time.

Best regards to all.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5581
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Tue Mar 12, 2019 6:44 pm

deli13 wrote:
Tue Mar 12, 2019 5:51 pm
@ShiftPlusOne thank you for your answer.

Now I have the following

[email protected]:~ $ sudo systemctl start hostapd
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
[email protected]:~ $ systemctl status hostapd.service
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2019-03-12 17:33:16 GMT; 45ms ago
Process: 8964 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)

Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Control process exited, code=exited status=1
Mar 12 17:33:16 DeliPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Unit entered failed state.
Mar 12 17:33:16 DeliPi systemd[1]: hostapd.service: Failed with result 'exit-code'.

I'm sorry if my next question look weak, but...
I'm going to have a business trip and I would really like to have my Raspberry ready for a hotel WiFi sharing. So, would Mr. Darkyere (or anyone else) be so kind to share image file of working set which is similar to mine. I would be so grateful.
I'm not lazy, I really enjoy playing with my Raspberry. But I don't have time.

Best regards to all.
What do your hostapd.conf and /etc/default/hostapd files look like?

These instructions worked for me when I tried them yesterday:
https://github.com/XECDesign/documentat ... s-point.md

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Tue Mar 12, 2019 8:18 pm

@ShiftPlusOne - let me go through the instructions you've posted. I will share my progress.

Regards.

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Wed Mar 13, 2019 6:33 pm

I have AP available in my WiFi list. But when connecting, I cannot get the IP address.
systemctl status dnsmasq gives the following:

Mar 13 18:02:57 DeliPi dnsmasq[561]: dnsmasq: syntax check OK.
Mar 13 18:02:59 DeliPi dnsmasq[659]: started, version 2.76 cachesize 150
Mar 13 18:02:59 DeliPi dnsmasq[659]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Mar 13 18:02:59 DeliPi dnsmasq[659]: warning: interface wlan1 does not currently exist
Mar 13 18:02:59 DeliPi dnsmasq-dhcp[659]: DHCP, IP range 192.168.10.2 -- 192.168.10.20, lease time 1d
Mar 13 18:02:59 DeliPi dnsmasq[659]: reading /run/dnsmasq/resolv.conf
Mar 13 18:02:59 DeliPi dnsmasq[659]: using nameserver 192.168.1.1#53
Mar 13 18:02:59 DeliPi dnsmasq[659]: read /etc/hosts - 5 addresses
Mar 13 18:02:59 DeliPi dnsmasq[661]: Too few arguments.
Mar 13 18:02:59 DeliPi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

It is strange that wlan1 doesn't exist, because dnsmasq.conf has:

interface=wlan1
dhcp-range=192.168.10.2,192.168.10.20,255.255.255.0,24h

To make clear, I'm trying to use two Edimax WiFi dongles: wlan0 connected to inet and wlan1 used for AP.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5581
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Wed Mar 13, 2019 6:50 pm

deli13 wrote:
Wed Mar 13, 2019 6:33 pm
I have AP available in my WiFi list. But when connecting, I cannot get the IP address.
systemctl status dnsmasq gives the following:

Mar 13 18:02:57 DeliPi dnsmasq[561]: dnsmasq: syntax check OK.
Mar 13 18:02:59 DeliPi dnsmasq[659]: started, version 2.76 cachesize 150
Mar 13 18:02:59 DeliPi dnsmasq[659]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Mar 13 18:02:59 DeliPi dnsmasq[659]: warning: interface wlan1 does not currently exist
Mar 13 18:02:59 DeliPi dnsmasq-dhcp[659]: DHCP, IP range 192.168.10.2 -- 192.168.10.20, lease time 1d
Mar 13 18:02:59 DeliPi dnsmasq[659]: reading /run/dnsmasq/resolv.conf
Mar 13 18:02:59 DeliPi dnsmasq[659]: using nameserver 192.168.1.1#53
Mar 13 18:02:59 DeliPi dnsmasq[659]: read /etc/hosts - 5 addresses
Mar 13 18:02:59 DeliPi dnsmasq[661]: Too few arguments.
Mar 13 18:02:59 DeliPi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

It is strange that wlan1 doesn't exist, because dnsmasq.conf has:

interface=wlan1
dhcp-range=192.168.10.2,192.168.10.20,255.255.255.0,24h

To make clear, I'm trying to use two Edimax WiFi dongles: wlan0 connected to inet and wlan1 used for AP.
What's the output of these commands?

Code: Select all

iw dev
iw list
lsmod

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Wed Mar 13, 2019 8:34 pm

[email protected]:~ $ iw dev
phy#1
Interface wlan1
ifindex 4
wdev 0x100000001
addr 74:da:38:ea:18:dd
ssid DeliPiAP
type AP
txpower 12.00 dBm
phy#0
Interface wlan0
ifindex 3
wdev 0x1
addr 74:da:38:ea:18:ab
ssid Deli Wi-Fi Network
type managed
txpower 12.00 dBm

iw list
Wiphy phy1
max # scan SSIDs: 9
max scan IEs length: 2304 bytes
max # sched scan SSIDs: 0
max # match sets: 0
max # scan plans: 1
max scan plan interval: -1
max scan plan iterations: 0
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP-128 (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* monitor
* P2P-client
* P2P-GO
Band 1:
Capabilities: 0x1862
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 7935 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT Max RX data rate: 150 Mbps
HT TX/RX MCS rate indexes supported: 0-7, 32
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps
* 5.5 Mbps
* 11.0 Mbps
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (disabled)
Band 2:
Capabilities: 0x1862
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 7935 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT Max RX data rate: 150 Mbps
HT TX/RX MCS rate indexes supported: 0-7, 32
Bitrates (non-HT):
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Frequencies:
* 5170 MHz [34] (disabled)
* 5180 MHz [36] (20.0 dBm)
* 5190 MHz [38] (20.0 dBm)
* 5200 MHz [40] (20.0 dBm)
* 5210 MHz [42] (20.0 dBm)
* 5220 MHz [44] (20.0 dBm)
* 5230 MHz [46] (20.0 dBm)
* 5240 MHz [48] (20.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (27.0 dBm) (radar detection)
* 5520 MHz [104] (27.0 dBm) (radar detection)
* 5540 MHz [108] (27.0 dBm) (radar detection)
* 5560 MHz [112] (27.0 dBm) (radar detection)
* 5580 MHz [116] (27.0 dBm) (radar detection)
* 5600 MHz [120] (27.0 dBm) (radar detection)
* 5620 MHz [124] (27.0 dBm) (radar detection)
* 5640 MHz [128] (27.0 dBm) (radar detection)
* 5660 MHz [132] (27.0 dBm) (radar detection)
* 5680 MHz [136] (27.0 dBm) (radar detection)
* 5700 MHz [140] (27.0 dBm) (radar detection)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)
* 5920 MHz [184] (disabled)
* 5940 MHz [188] (disabled)
* 5960 MHz [192] (disabled)
* 5980 MHz [196] (disabled)
* 6000 MHz [200] (disabled)
* 6020 MHz [204] (disabled)
* 6040 MHz [208] (disabled)
* 6060 MHz [212] (disabled)
* 6080 MHz [216] (disabled)
Supported commands:
* new_interface
* set_interface
* new_key
* start_ap
* new_station
* set_bss
* join_ibss
* set_pmksa
* del_pmksa
* flush_pmksa
* remain_on_channel
* frame
* set_channel
* connect
* disconnect
Supported TX frame types:
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
* IBSS: 0xd0
* managed: 0x40 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
software interface modes (can always be added):
* monitor
interface combinations are not supported
Device supports scan flush.
Wiphy phy0
max # scan SSIDs: 9
max scan IEs length: 2304 bytes
max # sched scan SSIDs: 0
max # match sets: 0
max # scan plans: 1
max scan plan interval: -1
max scan plan iterations: 0
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP-128 (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* monitor
* P2P-client
* P2P-GO
Band 1:
Capabilities: 0x1862
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 7935 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT Max RX data rate: 150 Mbps
HT TX/RX MCS rate indexes supported: 0-7, 32
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps
* 5.5 Mbps
* 11.0 Mbps
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (disabled)
Band 2:
Capabilities: 0x1862
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 7935 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT Max RX data rate: 150 Mbps
HT TX/RX MCS rate indexes supported: 0-7, 32
Bitrates (non-HT):
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Frequencies:
* 5170 MHz [34] (disabled)
* 5180 MHz [36] (20.0 dBm)
* 5190 MHz [38] (20.0 dBm)
* 5200 MHz [40] (20.0 dBm)
* 5210 MHz [42] (20.0 dBm)
* 5220 MHz [44] (20.0 dBm)
* 5230 MHz [46] (20.0 dBm)
* 5240 MHz [48] (20.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (27.0 dBm) (radar detection)
* 5520 MHz [104] (27.0 dBm) (radar detection)
* 5540 MHz [108] (27.0 dBm) (radar detection)
* 5560 MHz [112] (27.0 dBm) (radar detection)
* 5580 MHz [116] (27.0 dBm) (radar detection)
* 5600 MHz [120] (27.0 dBm) (radar detection)
* 5620 MHz [124] (27.0 dBm) (radar detection)
* 5640 MHz [128] (27.0 dBm) (radar detection)
* 5660 MHz [132] (27.0 dBm) (radar detection)
* 5680 MHz [136] (27.0 dBm) (radar detection)
* 5700 MHz [140] (27.0 dBm) (radar detection)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)
* 5920 MHz [184] (disabled)
* 5940 MHz [188] (disabled)
* 5960 MHz [192] (disabled)
* 5980 MHz [196] (disabled)
* 6000 MHz [200] (disabled)
* 6020 MHz [204] (disabled)
* 6040 MHz [208] (disabled)
* 6060 MHz [212] (disabled)
* 6080 MHz [216] (disabled)
Supported commands:
* new_interface
* set_interface
* new_key
* start_ap
* new_station
* set_bss
* join_ibss
* set_pmksa
* del_pmksa
* flush_pmksa
* remain_on_channel
* frame
* set_channel
* connect
* disconnect
Supported TX frame types:
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
* IBSS: 0xd0
* managed: 0x40 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
software interface modes (can always be added):
* monitor
interface combinations are not supported
Device supports scan flush.

[email protected]:~ $ lsmod
Module Size Used by
fuse 110592 3
ipt_MASQUERADE 16384 1
nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE
iptable_nat 16384 1
nf_conntrack_ipv4 16384 2
nf_defrag_ipv4 16384 1 nf_conntrack_ipv4
nf_nat_ipv4 16384 1 iptable_nat
nf_nat 28672 2 nf_nat_masquerade_ipv4,nf_nat_ipv4
nf_conntrack 126976 5 nf_conntrack_ipv4,ipt_MASQUERADE,nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat
bridge 122880 0
stp 16384 1 bridge
llc 16384 2 bridge,stp
8192cu 589824 0
joydev 20480 0
evdev 24576 4
cfg80211 573440 1 8192cu
rfkill 28672 4 cfg80211
snd_bcm2835 32768 1
snd_pcm 98304 1 snd_bcm2835
snd_timer 32768 1 snd_pcm
snd 69632 5 snd_timer,snd_bcm2835,snd_pcm
uio_pdrv_genirq 16384 0
fixed 16384 0
uio 20480 1 uio_pdrv_genirq
i2c_dev 16384 0
ip_tables 24576 1 iptable_nat
x_tables 32768 2 ip_tables,ipt_MASQUERADE
ipv6 425984 29 bridge

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5581
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Wed Mar 13, 2019 8:41 pm

Strange. wlan1 seems to be present, so I'm not sure what dnsmasq is complaining about.

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Fri Mar 15, 2019 6:43 pm

Redone from the scratch following the official manual
https://www.raspberrypi.org/documentati ... s-point.md

I have AP presented in my WIFI environment. But cannot connect. Even if I setup the IP address manually, I'm not able to connect

deli13
Posts: 10
Joined: Mon Mar 11, 2019 6:03 pm

Re: Need help to make an hostapd AP on an RPI2 Raspbian Stretch

Sat Mar 16, 2019 5:11 pm

Update to my previous post.

I have done everything from scratch. My Pi is connected to the Internet by eth0, the AP is built on wlan0.
I can connect all my devices to the AP (MacBook, iPad, Android Phone, laptop on Linux), the Internet is working for all of them.
But... Despite the fact, I have DHCP server on the Pi, IP address are taken from my router (192.168.1.1/24).
So, now questions are:

1. How to make devices get IP from the Pi's DHCP server (192.168.4.1/24)?
2. How to get the Pi connected to the Internet using wlan1 and reconfigure bridge for the schema:

Internet <--> wlan1 <br0> wlan0 <--> device

Return to “Networking and servers”