Fix ethernet interface following ASRock B450M-HDV’s UEFI update on Linux

I own an ASRock B450M-HDV for my home server, it was cheap. It’s currently paired with a Ryzen 3 2200G, but will be getting a Ryzen 5 5600G very quickly.

But to get a more recent CPU I need to update my UEFI from version 1.20 to 4.40. This is great because this means that my home server built cheap can properly evolve and extend its lifespan by a bit.

Symptom

After an UEFI update I always login and attempt to ping 8.8.8.8 but it wouldn’t reach.

No entry for the NIC exists within the UEFI but it is detected:

senpaisilver:~$ sudo lshw -C network
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:07:00.0
       logical name: enp7s0
       version: 15
       serial: 01:23:45:67:89:AB
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.3 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:36 ioport:f000(size=256) memory:fcd04000-fcd04fff memory:fcd00000-fcd03fff

Resolving the solution

This is a walk in the part, when querying the NICs I need to get the logical name:

senpaisilver:~$ sudo lshw -C network | grep "logical name:"
logical name: enp7s0

In my case I’m interested in the enp7s0, this will be the string I will have to update in my netplan. In my case there’s only one netplan /etc/netplan/ which is 50-cloud-init.yaml (may differ on other installations).

In that file we need to copy the logical name in the ethernets section like so:

network:
    ethernets:
        enp7s0:
            dhcp4: true
    version: 2

Save and then run the following commands to enable the new netplan:

sudo netplan generate
sudo netplan apply

If everything works you should be able to reach the internet, otherwise try rebooting.

Why update the CPU?

I’m been having issues with slow encoding and to be honest the Ryzen 3 2200G was a low cost way of getting started, I need more power and I’ll probably update the SSD to a proper NVMe PCI-E 3.0 one if the need arises.

But by the end of the day I need more CPU performance and I’ll be need more RAM too for a PhotoPrism instance too. Maybe it would be a great moment to properly setup a Grafana dashboard too since I already have most of the docker compose file ready.

So much to do… So much to do…

Update 2022/01/08

I received the Ryzen 5 5600G and proceeded to install it, after working for a few minutes the screen would turn off and sleep. The reset and power buttons wouldn’t register at all, the ethernet would cut off meaning I had no other option than to pull the plug (or use the PSU’s switch).

Continue reading Fix ethernet interface following ASRock B450M-HDV’s UEFI update on Linux