8

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.

0

2 Answers 2

12

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
* #{ AP, mesh point } <= 8,
total <= 8, #channels <= 1
  • rtl8192cu dongles, 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.

3
  • 1
    I think this is the answer. On my own card it's said: "interface combinations are not supported" Dec 16, 2016 at 12:26
  • 1
    @Alex Stragies Regarding your statement that all Wifi interfaces on a single physical radio must be operating on the same frequency. Why is that the case? It's possible to scan for wifi signals using something like iw dev wlan0 scan and it will return results on all frequencies that the antenna supports, even if you're connected to a network (e.g., 2412Mhz). This seems to suggest that the physical device can operate on more than one frequency at once? So why can't we have multiple virtual interfaces with a different frequency? Dec 23, 2018 at 20:52
  • 1
    @FilipKilibarda I updated my answer, also in passing addressing your point. My Intel card -when i bought it- (iirc) could establish a connection, and also scan for other networks without disconnecting. Later at some point a newer version of the driver and firmware brought simultaneous dual-band usage. Mar 10, 2021 at 18:24
3

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).

3
  • I think, I understand your explanation. But, Think of Wireshark. With wireshark, You can listen to every packet from all APs/Stations around. Because, Linux drivers can let you to see every packet, No matter what it's destination MAC address is. In this way. I think as we can see every packet, We would also connect to more than one access point using single card. Dec 7, 2016 at 10:18
  • If you need to connect to multiple APs the simplest way would be to add another Wifi card to your computer. This would give you a full Layer1 Network connection to another AP without having to dive into modifying drivers.
    – 111---
    Dec 8, 2016 at 14:27
  • Wireshark definitely show you all of the broadcast traffic on a network, but I am not sure how you can configure Wireshark to snoop on all Wifi traffic on a network, regardless of its destination. I really can't say if Wifi cards can operate in a promiscuous mode, and snoop traffic that is only between an AP and another Client.
    – 111---
    Dec 8, 2016 at 14:29

You must log in to answer this question.

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