5

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

/etc/network/interfaces
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
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
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
6

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.

/etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="address:one", NAME="wlan0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="address:two", NAME="wlan1"
-1

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.