RTL8188CUS AP and Client mode simultaneously with hostapd in Linux?

It depends on network cards. I do not own an RTL8188, so i cannot tell you off-hand, but I can show you how to find out.

You must issue the command

 iw list

and, among its abundant output, you will find something like:

Supported interface modes:
             * IBSS
             * managed
             * AP
             * AP/VLAN
             * monitor
    software interface modes (can always be added):
             * AP/VLAN
             * monitor
    valid interface combinations:
             * #{ managed } <= 1, #{ AP } <= 1,
               total <= 2, #channels <= 1, STA/AP BI must match
             * #{ managed } <= 2,
               total <= 2, #channels <= 1

AP mode is the Access Point mode, managed is the usual client mode, and this is for my card.

You must check that both AP and managed appear among the supported modes, then you must check the valid interface combinations: in my case, the first allowed combination is clearly that of a (simultaneous) AP and managed mode (but no more than one each), provided the same channel is used. It might be different in your case.

In order to make this work, you must have two distinct virtual interfaces on the same NIC. You do it as follows:

service network-manager stop
iw dev wlan0 del
iw phy phy0 interface add new0 type station
service network-manager start
iw phy phy0 interface add new1 type __ap
hostapd -B /etc/hostapd.conf

First I stop the network manager, which has its own way of messing everything up, then I rename new0 the virtual interface on the physical interface called phy0 (adapt it to your case if yours is not called phy0, you obtain the name from the output of iw list), restart the network manager so that I can connect the virtual interface new0 to whichever AP I have near me.

Now I can add a new interface of type AP on the same hardware (please notice the double underscore preceding ap in the command), lastly I start hostpad.

The configuration of hostapd and of routing/DNS/DHCP depends on your specific needs, and cannot be established a priori.


I managed to solve my problem after a couple of weeks of research.

Simple answer is;

The command iw does not find any indications of mixed modes on RTL chips. The reason being that the RTL drivers by default do not support mixed modes.

Realtek call this Concurrent modes, and the RTL drivers are by default compiled with the concurrent mode-related code commented out.

In order to compile the drivers with concurrent mode activated you need to simply uncomment 3 lines of code in their source code.

Concurrent modes supported are STA+STA, STA+AP, STA+P2P.

You can find my full back-story and full guide on how to compile the drivers and the RTL compatible HOSTAPD version on this link:

http://randomstuffidosometimes.blogspot.se/2016/03/rtl8192cu-and-rtl8188cus-in-station-and.html