Skip to content

Instantly share code, notes, and snippets.

@cyan198
Last active November 3, 2022 12:14
Show Gist options
  • Save cyan198/6ecdb86267498a51587b4337e47e10f6 to your computer and use it in GitHub Desktop.
Save cyan198/6ecdb86267498a51587b4337e47e10f6 to your computer and use it in GitHub Desktop.
Setup WiFi with snap on Ubuntu Core

Connect to WiFi on Ubuntu Core using Snap

It was done on the following environment:

  • Raspberry Pi 3 Model B
  • OS: Ubuntu Core
  • Pi is connected to internet via Ethernet

Here are the overview of the steps:

  1. Install Network Manager using Snap
  2. Enable the WiFi interface
  3. Connect to Wifi network WPA2/WEP
  4. Connect to Wifi network WPA2 EAP

Step 1. Install Network Manager using Snap

snap install network-manager

Step 2. Enable the WiFi interface

Turn on the WiFi interface

network-manager.nmcli r wifi on

And verify the WiFi is on

network-manager.nmcli r

Step 3. Connect to WiFi network WPA2/WEP

List the available network

network-manager.nmcli d wifi list

Connect to a network

network-manager.nmcli d wifi connect <ssid> password <password>

Verify it is connected to WiFi

network-manager.nmcli c

Step 4. Connect to WiFi network WPA2 EAP

$ network-manager.nmcli connection edit type 802-11-wireless
nmcli> goto 802-11-wireless
nmcli 802-11-wireless> set ssid <your_ssid>
nmcli 802-11-wireless> back
nmcli> goto 802-11-wireless-security
nmcli 802-11-wireless-security> set key-mgmt wpa-eap
nmcli 802-11-wireless-security> set auth-alg open
nmcli 802-11-wireless-security> back
nmcli> goto 802-1x
nmcli 802-1x> set eap peap
nmcli 802-1x> set identity <your_identity>
nmcli 802-1x> set password <your_password>
nmcli 802-1x> set phase2-auth mschapv2
nmcli 802-1x> back
nmcli> verify
nmcli> save
Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.
Do you still want to save? (yes/no) [yes] yes
Connection 'wifi' (20e7bab0-6780-45a7-b650-eafb28e7912a) successfully saved.

References

[Ubuntu Core Documentation]Install NetworkManager

[Ubuntu Core Documentation]Configure WiFi Connections

nm-settings

nmcli-examples

@bkrajendra
Copy link

how to do this if there is no wifi and networks on rpi in first place.

@cyan198
Copy link
Author

cyan198 commented Oct 29, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment