15

I've finally installed the drivers for my wireless adapter, however, I can't seem to find anything explaining out to connect to a WPA2-Enterprise connection. I've found many WPA/WEP/WPA2 explanations, however, these don't solve my situations.

Is there any way to do this? I'm currently CLI only, thanks!

17

You can use nmcli

# nmcli con add type wifi ifname wlan0 con-name CONNECTION_NAME ssid SSID
# nmcli con edit id CONNECTION_NAME
nmcli> set ipv4.method auto
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set 802-1x.identity USERNAME
nmcli> save
nmcli> activate

You may also need to add

  • nmcli> set 802-1x.password PASSWORD
  • nmcli> set 802-1x.anonymous-identity ANONYMOUS-IDENTITY
  • nmcli> set wifi-sec.key-mgmt wpa-eap
1
  • 1
    I successfully used this answer to connect to Eduroam from the console on someone's messed-up Ubuntu 14/16 laptop that couldn't start Gnome and didn't have wpa_supplicant installed (user had turned off laptop while do-release-upgrade was running from 14 to 16, and their home directory was on a full read-only ext2 partition due to somebody having "set up Linux" for them in a shop without knowing what he was doing). I needed to run /etc/init.d/network-manager start first, and needed to set 802-1x.anonymous-identity as well as identity, both to Eduroam ID. – Silas S. Brown Mar 13 '20 at 12:25
3

wpa_supplicant is the answer. It supports WPA-Enterprise and several EAP methods. I connect to my home network by executing:

wpa_supplicant -i wlan0 -B -c /path/to/wpa_supplicant.conf

Here is an example of configuration file. It's all about configuring this file to match your connection.

0

None of the answers here worked for me, and after several attempts with nmcli, I eventually gave up and used the Ubuntu 18.04 network interface to create a connection and the I copied it over to the other computer. Here are the steps I followed:

  1. Create the network connection within the Ubuntu network connection GUI.
  2. Copy the new connection from /etc/NetworkManager/system-connections/ on my local compute over to the headless server.
  3. Edit the MAC ID of the connection to match the interfaces from ifconfig.
  4. Update the permissions of the copied file with:
chmod 0600 new_connection
chmod root:root new_connection
  1. Restart the network manager
systemctl restart NetworkManager

For those of you that don't want to manually create the network connection in the GUI, you can modify the following network connection

[connection]
id=new_connection
uuid=axxxxf1f-xxxx-494c-980a-xxxxxxxxxxx
type=wifi
permissions=

[wifi]
mac-address=XX:XX:XX:XX:XX:XX
mac-address-blacklist=
mode=infrastructure
ssid=some_wifi_ssid

[wifi-security]
key-mgmt=wpa-eap

[802-1x]
eap=peap;
identity=redacted_username
password=redacted_password
phase2-auth=mschapv2

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

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.