Connecting to new Wifi network

I am using Ubuntu Core on the Intel Joule. I went through all of the setup and everything was fine. I connected to a wifi network and am able to SSH into the Joule. However, we just set up a new wifi network in the office specifically for this, and I cannot figure out how to switch to a new wifi network. The way I originally connected to the current network was just through the "first boot" configuration step.

Is there a way to switch to a different wifi network?

Thanks.


Solution 1:

Note that you should be able to simply run sudo console-conf, which is that first-boot setup you've already gone through. But it doesn't support more complex networking setups, so a more thorough answer is:

The Ubuntu Core images utilize netplan, and uses the systemd-networkd backend for it. I don't have a Joule on hand, but I have my Dragon board here, and I used the first boot setup to configure a wired ethernet connection. Let me walk you through what I'd do with netplan to setup a wireless connection.

  1. Modify /etc/netplan/00-snapd-config.yaml. This is the file generated by console-conf on first boot. Since I configured the wired connection on first boot, mine looked like this:

    # This is the network config written by 'console-conf'
    network:
      ethernets:
        eth0:
          addresses: []
          dhcp4: true
      version: 2
    

    Since I wanted to enable wifi, I updated this file to this:

    # This is the network config written by 'console-conf'
    network:
      ethernets:
        eth0:
          addresses: []
          dhcp4: true
      wifis:
        wlan0:
          access-points:
            <access point name>:
              password: <password>
          dhcp4: true
      version: 2
    
  2. Run sudo netplan generate to generate the necessary backend configuration for systemd-networkd.

  3. Run sudo netplan apply to actually apply the new config.

You can run networkctl periodically and you'll see the interfaces come up.