$ sudo apt update
$ sudo apt install wireless-tools wpasupplicant
$ sudo lshw -C Network
...
*-network:1 DISABLED
description: Wireless interface
...
logical name: wlXXX
...
$ sudo ip a
3: wlXXX: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether ... brd ff:ff:ff:ff:ff:ff
$ sudo ifconfig wlXXX up
OR
$ sudo ip link set wlXXX up
$ sudo lshw -C Network
// now DISABLED disappeared
...
*-network:1
...
$ ls -l /etc/netplan
total 16
drwxr-xr-x 2 root root 4096 Aug 17 03:14 ./
drwxr-xr-x 98 root root 4096 Aug 17 07:40 ../
-rw------- 1 root root 86 Aug 17 03:14 00-installer-config-wifi.yaml
-rw-r--r-- 1 root root 117 Aug 17 03:14 00-installer-config.yaml
$ sudo vi /etc/netplan/00-installer-config-wifi.yaml
# This is the network config written by 'subiquity'
network:
version: 2
wifis:
wlx64e599f45976:
dhcp4: yes
dhcp6: yes
access-points:
"SSID name":
password: "password"
$ sudo netplan generate
$ sudo netplan apply
$ sudo ip a
...
3: wlXXX: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ... brd ff:ff:ff:ff:ff:ff
inet local_IP ...
....
$ sudo reboot now
After reboot, it takes time (possibly more than minutes) to be able to connect to the wireless connection.
(Mac) $ ssh local_IP
If the new dynamic IP is the same with the that of the old installation, the connection can be failed with a waring message.
Then delete the corresponding row in the file:
$ vi ~/.ssh/known_hosts
And ssh again.
-------- the following is old method --------
$ sudo iwlist wlXXX scan |grep SSID
// but my network is hidden and hence does not appear
$ sudo wpa_passphrase ownet2 <passphrase> > /etc/wpa_supplicant.conf
$ sudo wpa_supplicant -B -iwlXXX -c/etc/wpa_supplicant.conf
// B is fo background running
// but it's not working
// Try with network-manager
$ sudo apt install network-manager
$ sudo systemctl start network-manager
$ nmcli d
DEVICE TYPE STATE CONNECTION
wlXXX wifi disconnected --
...
$ nmcli dev wifi
IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY
...
// while doing various thing, the device became unavailable. Maybe this causes problems.
$ sudo nmcli d
DEVICE TYPE STATE CONNECTION
wlXXX wifi unavailable --
// rebooting solves the problem
// from the "man nmcli" see "device" argument section
$ sudo nmcli device wifi connect "<network name>" password <password> ifname wlXXX hidden yes
// NOTE: network name should be in "", password can be passphrase (not hexadecimal)
$ sudo nmcli device
DEVICE TYPE STATE CONNECTION
wlXXX wifi connected ownet2
$ sudo nmcli connection show
NAME UUID TYPE DEVICE
ownet2 ... wifi wlXXX
$ sudo ifconfig
wlXXX: flags=...
inet ...
// inet (local IP address) appears now
// After rebooting, it is still working. No need to prepare some start-up process. Maybe network-manager daemon is working.