Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been able to create a wireless access point (on my raspberry pi) using a usb wifi dongle using hostapd on wlan0. What I would like to be able to do is have the access point be on some virtual interface (i.e. wlan0:1) or vlan (wlan0.123) and have wlan0 connect to an existing access point.

That way I can connect to the device via the access point it provides, or through the network that it was able to connect to.

The end goal is this: I can connect to the device using the access point it provides. It will then do a scan of wireless access points it finds, ask me which one I would like to connect to, and then attempt to connect to it. It can then tell me the IP address it was able to get on that new connection or tell me that it failed to connect (because I will still be connected via the access point it is providing).

If there is some other way to do this (without having two physical wifi adapters) I'm all ears.

For now, the steps I am taking are to get the AP working on the vlan interface. That is not working... the AP is visible, but it seems that the DHCP server is not issuing an IP address.

Here are the contents of /etc/network/interfaces:

auto lo
auto wlan0 wlan0.10
auto eth0

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0.10 inet static
  vlan_raw_device wlan0

iface wlan0 inet manual

Here are the contents of hostapd.conf:


Note that above I had to say the interface is wlan0. It seems hostapd does not like it if I put wlan0.10.

Finally here is my dhcp configuration (isc-dhcp-server):

shared-network VLAN10 {
subnet netmask {
       option broadcast-address;
       option routers;
       default routers;
       default-lease-time 600;
       max-lease-time 7200;
       option domain-name "local";

It appears that the AP/dhcp doesn't like being on a VLAN as my phone seems to get stuck on "Obtaining IP address from RPiAP...". Or maybe I have to do some iptables rules to remove the tagging?

share|improve this question
I am not trying to bridge them but have two ways to access the device. One via the access point it provides. Another via the LAN it connects to. – Gabe Jun 26 '13 at 13:44
can you check the logs to see If the dhcp server receives any requests ? – Lawrence Sep 4 '13 at 10:19
As I know, is impossible to work AP and station at same time on same physical WLAN interface. – mmv-ru May 18 '14 at 13:42
@mmv-ru That’s not true. There are plenty of devices out there that can do both at the same time. Obligatory warning though: Because AP mode requires a fixed channel, the client interface will be limited to this channel. – Daniel B Mar 15 '15 at 12:27

The hostap and dhcp server is working fine, but te time of your mobilephone and the raspberry pi not is sincronized. Try to put the same time both devices.

share|improve this answer

You must log in to answer this question.

protected by Community May 18 '14 at 13:05

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .