I have two wifi dongles connected to a RPi. I like to use one dongle (Edimax) as primary connection to my home router, and the other as access point (this one being an AWUS036NH). How can I force that the interfaces in /etc/network/interfaces are set up so that it always uses the Edimax for connecting to the router? I tried to add the hwadress to iface but more often than not it will use the wrong wifi dongle to connect to the router. Below is my interfaces file.

Thanks for any comments? Christian

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
#static ip instead
iface edimax inet static
hwaddress ether <edimax_mac_address>
# trying to set the edimax as primary wifi-dongle
# "edimax" is the id_str set in /etc/wpa_supplicant/wpa_supplicant.conf

2 Answers 2


I found out myself...it is actually very easy: I just have to add rules to the udev system to assign explicit names to the usb dongles (depending on their mac address). Then interfaces can be set up accordingly.

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="address:one", NAME="wlan0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="address:two", NAME="wlan1"

Turn mac filtering on on your router. Add Edimax MAC address to the router and give static ip addres.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.