Manual Configuration or WPA Supplicant for WiFi on a University Network

network-interfacenetworkingnetworkmanagerwifiwpa-supplicant

I am using Debian Stretch/Testing with Xfce. I have an eight year old Acer laptop. I am currently using network-manager-gnome to connect to WiFi from the laptop at the university where I teach.

Most of the time I have no issue. However, something strange has been happening. On Mondays, only on Mondays (every Monday for the past three weeks). My connection will work for about two to three minutes, and then it will slow to a halt. It actually did the same thing today when connected to a WiFi hotspot I created on my phone. My phone works fine on the university WiFi at these same times.

Today, while using network-manager-gnome, my WiFi hotspot connection died. So I disabled Network Manager and I connected to the hotspot via manual configuration. This WiFi connection worked perfectly fine.

For manual configuration I have the /etc/network/interfaces file that sources to the interfaces.d directory. I have created /etc/network/interfaces.d/wlan0. It has content like this:

auto wlan_home
iface wlan_home inet dhcp
    wpa-ssid home-network-ssid
    wpa-psk secret-key

auto wlan_hotspot
iface wlan_hotspot inet dhcp
    wpa-ssid wifi-hotspot-ssid
    wpa-psk secret-key

To connect I use the command (example of home network):

sudo ifup wlan0=wlan_home

(I of course have the proper r/w permissions (chmod 600) set to the wlan0 file as well as a generated key instead of my actual password.)

Now to my question. I would like to add the proper configuration information to the wlan0 file to be able to connect to my university network. I would like to be able to connect using this manual configuration for when Network Manager fizzles out. Here is the general information used to connect in nm-connection-editor. I have been unable to find any guide on the proper connection information to place in my file. Otherwise, perhaps the only option is to set up the connection with the wpa_supplicant.conf file.

University WiFi Settings

Best Answer

I would recommend not to use different network interface for different WLANs, but instead use one interface and the roaming mode if wpa_supplicant, using wpa_supplicant.conf for the WLAN details. That's how I do it on my laptop.

So my /etc/network/interfaces looks like

iface wlan0 inet dhcp
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

and in my wpa_supplicant.conf, I have something like

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

network={
  ssid="first_ssid"
  psk="blah1"
  priority=30
}

network={
  ssid="second_ssid"
  psk="blah2"
  priority=50
}

etc. Nice and easy. I have't set up EAP this way yet, but there are options you can use to specify this.

You can also use wpa_cli or wpa_gui to add other networks etc. on the fly, if needed. wpa_cli is scriptable.

(Of course the really interesting question is: what happens every Monday to make your connection fail?)

Related Question