systemd-networkd - No networking in recovery mode

Solution 1:

1: Boot to recovery mode

2: Drop to a root shell prompt (read only)

3: Remount file system to read and write:

mount --options remount,rw /
mount --all

4: Add dns server just to be safe that DNS will work:

vi /etc/resolv.conf

add

nameserver 8.8.8.8

(8.8.8.8 is the Google DNS server)

5: Reboot and get into a root shell again with read/write access Remount to read and write:

mount --options remount,rw /
mount --all

6: Stop networking:

systemctl stop network-manager

7: Setup wireless connection and scan:

ifconfig wlan_name up

iwlist wlan_name scan

8: Create wpa configuration file and connect:

wpa_passphrase NETWORK_ID WIRELESS_KEY > /home/(username)/wpa.conf

wpa_supplicant -B -i wlan_name -c /home/(username)/wpa.conf

Ignore any IOCSIWENCODEEXT and SIOCSIWGENIE errors, and finally run:

dhclient wlan_name

If you don't want to create a file to save your config, use these commands instead:

iwconfig wlan_name essid NETWORK_ID key s:WIRELESS_KEY

dhclient wlan_name

Source:

https://ubuntuforums.org/showthread.php?t=2164398