0

I have a Ubuntu server (14.04) embedded machine and I would like to be able to change the WiFi dongle without having to create a new interface.

Indeed, when I plug a new wlan interface, it is seen as wlan(N+1).

I would see two 'solutions' but I don't know how do it:

  • Make a default WPA settings that any wlan interface will use (preferred)
  • Make sure any wlan interface I plug will be seen as wlan0 (while only one interface is plugged in at the same time)
1

A sample script to connect through wpa_supplicant independently of the wifi interface name ( wlan0 , ... wlanN)

#!/bin/bash
killall wpa_supplicant
i=$(iw dev | grep Interface | awk '{ print $2}')
wpa_supplicant -i $i -c/etc/wpa_supplicant/wpa_supplicant.conf -B
dhclient $i

The /etc/wpa_supplicant/wpa_supplicant.conf configuration file should contain the following lines:

ctrl_interface=/run/wpa_supplicant
update_config=1
ap_scan=1

network={
         ssid="your_ssid"
         psk="your_wifi_password"
        }

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.