I clean installed 20.04 LTS but now I have no network

Solution 1:

The r8168 driver is included in the Ubuntu repositories so you don't need to compile it yourself, so first, try this:

sudo rmmod r8169 r8168
sudo apt-get purge r8168-dkms
sudo modprobe r8169
dmesg | egrep -i 'eth|net|r816'
ifconfig -a

If there were no errors reported by the modprobe or found in dmesg then you should see an ethernet device in the ifconfig output (in addition to the lo device).

If not, try the r8168 driver:

sudo rmmod r8169
sudo apt-get install r8168-dkms
sudo modprobe r8168
dmesg | egrep -i 'eth|net|r816'
ifconfig -a

If you still get no ethernet device, add the output of:

find /lib -name r816\*
lsmod
dmesg | egrep -i 'eth|net|r816|error|fail'
ifconfig -a

to the original question.

Solution 2:

It turned out it was a known issue with the motherboard:

https://bugs.launchpad.net/ubuntu/+source/linux-signed/+bug/1876593

Problem resolved by upgrading BIOS to latest and turning on LAN Boot option as suggested in the bug report. Thanks to Wayne Vosberg.