mac80211 Multiple Virtual Interface (vif) Support
The mac80211 subsystem in the linux kernel supports multiple wireless interfaces to be created with one physical wireless card. This depends on the driver implementing this. This could allow you to join multiple networks at once, or connect to one network while routing traffic from an access point interface.
Notes on Terminology and Omissions
Throughout this documentation, all references to the wireless device that virtual interfaces are being created on are done by the physical name phy0. If you have multiple wireless cards, you may need to use phy1 or phy2.
This document only covers the creation and configuration of the wireless side of the network. Once complete, the interfaces are configured the same as you would configure a wired interface on your system, and those details are documented very well, and in great depth by most distributions.
The basic syntax to create an interface is:
iw dev <devname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*]
iw phy <phyname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*]
while the basic syntax to destroy an interface is:
iw dev <devname> del
The <devname> and <phyname> fields represent the virtual interface(devname) and physical device(phyname). <devname> is often wlan0, wlan1, etc, while <phyname> is phy0, phy1, etc.
The <name> field is where you choose what to call the new virtual interface(it's new devname).
The <type> field is where you define what sort of interface you're creating. It is one of:
An IBSS (Independent Basic Service Set) network, often called an ad-hoc network, is a way to have a group of devices talk to each other wirelessly, without a central controller. All devices talk directly to each other, with no inherent relaying.
To create an ad-hoc network, you first create an ad-hoc interface(named ah0): iw phy <phyname> interface add <devname> type ibss
example: iw phy phy0 interface add ah0 type ibss
Next you join/create the ibss: iw dev <devname> ibss join <SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [key d:0:abcde]
example: iw dev ah0 ibss join AdHocNetworkName 2412
Repeat these steps on all devices you want to network together.