I have two wireless dongles attached to my Pi B+:
- wlan0/RALINK is for network connectivity
- wlan1/TPLINK is for monitor mode traffic analysis
The problem is, they change unpredictably (even without something obvious like changing which USB ports they're plugged into). Sometimes wlan1 is the TPLINK dongle, sometimes it's the RALINK dongle. This messes up my scripts, which assume wlan1 will be the TPLINK dongle.
How can I force the RALINK dongle to always be wlan0, and the TPLINK dongle to always be wlan1? Is there a way to bind a USB ID or MAC address to a certain interface? How is the network interface for each device chosen - by the order of USB ports all the devices are plugged into?