virtual interfaces
hi all,
I'm having problems creating virtual managed interfaces. Last time I used the drivers I did it through debugfs and it worked fine. Now the debugfs directory structure is different and I used iw to create the interfaces. The problem is that it creates an interface named like wlan1_rename that as the same mac address as the others interfaces, so I can't bring it up.
Is there another way to create virtual interfaces?
Best Regards
Rodolphe Marques
Quoted 10 lines · Rodolphe Marques
hi all,
I'm having problems creating virtual managed interfaces. Last time I used the drivers I did it through debugfs and it worked fine. Now the debugfs directory structure is different and I used iw to create the interfaces. The problem is that it creates an interface named like
wlan1_renamethat as the same mac address as the others interfaces, so I can't bring it up.Is there another way to create virtual interfaces?
I used echo add > /sys/kernel/debug/ath9k/phy0/wiphy
Then I started hostapd on wlan1, and a regular supplicant on wlan0, which was the original interface. The MAC address of wlan1 should be similar to wlan0 except its xor'd with the virtual wiphy ID amongst other things. This is done as follows:
memcpy(addr, sc->sc_ah->macaddr, ETH_ALEN);
addr[0] |= 0x02; /* Locally managed address */
/*
* XOR virtual wiphy index into the least significant bits to generate
* a different MAC address for each virtual wiphy.
*/
addr[5] ^= i & 0xff;
addr[4] ^= (i & 0xff00) >> 8;
addr[3] ^= (i & 0xff0000) >> 16;
SET_IEEE80211_PERM_ADDR(hw, addr);I tested virtual wiphy stuff on ath9k yesterday even on top of my patches and it worked fine.
iw is used to create another interface, not an ath9k virtual interface, the difference being that a virtual ath9k interface is internal to ath9k and supports working on different channels. With iw you may or may not be able to create a STA interface and an AP interface for ath9k, I don't think its possible, I forget. You can however, uses iw to create a monitor interface, for example while still having and keeping a wlan0.
Luis