Wired Connection occasionally disconnects Ubuntu 20.04.1

From the comments...

The Internet disappears, however the NetworkManager icon in the System Tray still shows its normal icon. (So it doesn't appear to be a MSI interrupt problem).

The user is using a CAT6 ethernet cable, and does show a 1G connection when viewed with lshw -C network.

The current configuration is using the stock r8169 driver, which is known to have the same problem as in the question.

We replace the r8169 driver by installing dkms and r8168-dkms and rebooting. We then observe to see if the problem is fixed.

Update #1:

On the chance that this IS a MSI/MSI-X problem, try this script...

#!/bin/sh

# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817

# filename: r8169_disable_msi

# Drop it in /etc/initramfs-tools/scripts/init-top and chmod a+x it. Add 'r8169_disable_msi'
# to your kernel command line (/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# usually.) 

# Remember to update-initramfs and update-grub as necessary.

# sudo update-initramfs -c -k $(uname -r)
# sudo update-grub
# reboot

# For the moment it disables MSI on everything with the ID 0x10ec:0x8168, as there seems to
# be no way to get the MAC version from userspace - and certainly not before the driver is
# loaded. Other PCI IDs may need adding..

PREREQ=""
prereqs()
{
    echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
    prereqs
    exit 0
    ;;
esac

disable_msi () {
    for i in /sys/bus/pci/devices/*; do 
        if [ $(cat $i/vendor) = "0x10ec" -a $(cat $i/device) = "0x8168" ]; then
            echo 0 >$i/msi_bus
        fi
    done
}

for x in $(cat /proc/cmdline); do
        case ${x} in
        r8169_disable_msi)
        disable_msi
        break
                ;;
        esac
done