WPA Supplicant is needed!
Also the interface is needed that can be obtained using iw dev
$ wpa_passphrase myrouter mypassphrase > wpa.conf
$ wpa_supplicant -Dwext -i{interface name} -c/path/to/wpa.conf
$ dhclient {interface name}
Resolve DNS problems:
/etc/resolv.conf
nameserver 1.1.1.1
sudo systemctl restart systemd-resolved.service
After getting online, better to use nmtui
Tags linux