As we know, We can create virtual wireless interface using iw dev (1). Also, We can change it’s MAC address using ifconfig <ifname> hw ether <Address>. Then We can Set two different access points (SSIDs) to each of these inetrfaces using Network Manager.
For example:
(Real) wlan0: 00:16:b6:ab:cd:e7 -> AP(1) (Virtual) wlan1: 00:16:b6:ab:cd:e8 -> AP(2)
But whenever wlan0 is connected to AP(1), And I try to connect to AP(2), First the wlan0 disconnects and then wlan1 connects to it’s own AP.
I need to connect both of them simultaneously. Is it possible? How?
Edit: My specific card is a Lisco/Linksys RTL8191SEvB. I run Linux 4.4.38.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Some(Most in 2021?) Wifi-chips can function in several modes at the same time, but all on the same frequency, because they use the same radio. Now, If you have 2 radios attached to your chip, you could have several functions on several frequencies/channels.
Update 2021: Some cards can work on 2 Channels at the same time. These are 2.4/5Ghz combination devices, and most of those can do 1 of the 2.4, and another 1 from the 5Ghz Channels at the same. Some devices received this function via a FW upgrade, e.g. some Intel Cards.
Some other cards, like the one the PI ZeroW, can do 2 channels in the 2.4Ghz group at the same time.
E.g. the Intel 3160 can be 1 station, 1 Access-Point, AND 1 P2P device at the same time. This is used for WiDi or Miracast, while still being connected to the “other” Network.
The valid combinations for your chip can be seen as root with:iw list | grep -A 8 'interface combination'
Some examples:
-
Intel 3160:
valid interface combinations:
* #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
total <= 3, #channels <= 2 - Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
* #{ AP, mesh point } <= 8, #{ managed } <= 1,
total <= 8, #channels <= 1, STA/AP BI must match
- Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 31)
* #{ managed } <= 2, #{ AP, mesh point, P2P-client, P2P-GO } <= 2, #{ P2P-device } <= 1,
total <= 4, #channels <= 1
* #{ managed } <= 2, #{ P2P-client } <= 2, #{ AP, mesh point, P2P-GO } <= 1, #{ P2P-device } <= 1,
total <= 4, #channels <= 2
* #{ managed } <= 1, #{ IBSS } <= 1,
total <= 2, #channels <= 1
- PI Zero Wireless
* #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
total <= 3, #channels <= 2
* #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
total <= 4, #channels <= 1
- USB MediaTek Inc., driver mt76x0u
* #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 2,
total <= 2, #channels <= 1, STA/AP BI must match
rt2800usbreports:
* #{ AP, mesh point } <= 8,
total <= 8, #channels <= 1
rtl8192cudongles, that use the same chip as your device, and most Realtek devices report:
interface combinations not supported
This message means, that your card can only perform 1 function at the same time.
For some wifi-chips several signed firmwares with differing capabilities are available. AFAICT, not for your rtl819x though.
For an Intel IWLWifi a solution could have been to switch (one of the) connections to you being the AP, or making it “Ad-Hoc”
Otherwise you’d have to replace your card with one that has #{managed}<5 or similarly relaxed restrictions.
Or, add a(nother) 10€ WUSB-WiFi-dongle for connection to the second AP.
Method 2
As close as you may seem to getting this to work, I am going to go out on a limb and suggest that this is not possible.
You do have the virtual interfaces set up correctly, giving you both a valid MAC address on the interfaces (layer 2) and good IP addresses (layer 3). However the actual connection to the AP is done over Radio Frequency, which is Layer 1.
Think of it this way, unless your wired ethernet card has two physical ethernet ports (RJ45, fiber, etc.) you can only ever plug into one network physically. The same goes for your wifi card.
Unless your Wifi card has more than one antenna (that you can control independently) then the Wifi card will only support one connection mode, either AP mode (receiving incoming connections) or a client (one to one). There may be Wifi cards that will let you do this, but it seems like this would need to be supported in firmware, not just in your computer’s network stack (which you have properly configured).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0