Network randomly drops out

Fedora 38

Every now and then, seemingly randomly but fairly frequently, my computer will lose all network connection. The rest of the network is fine, the cabling is fine, it just drops out. After having done some googling I’ve found how to fix it each time, but it’s only a matter of time until it does it again. it does it so frequently that I’ve created a script and just run that every time it drops out, and it fixes it every time so I know it’s not a hardware fault. This is the script I run:

ip route flush table main
systemctl restart NetworkManager
ifdown enp3s0
ifup enp3s0

Today it did it again, and using PRTG I was able to track down what time it went down (I came back to my computer in the afternoon and when I logged on it was down, so I had to find when it happened. It has occasionally just up and quit on me while logged in and using the computer as well) and located the relevant journalctl logs, which are here:

Feb 10 11:29:37 minipc systemd-resolved[860]: enp3s0: Bus client reset search domain list.
Feb 10 11:29:37 minipc systemd-resolved[860]: enp3s0: Bus client set default route setting: no
Feb 10 11:29:37 minipc systemd-resolved[860]: enp3s0: Bus client reset DNS server list.
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5073] device (enp3s0): state change: activated -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5081] device (enp3s0): released from master device br0
Feb 10 11:29:37 minipc NetworkManager[1368]: <warn>  [1707586177.5083] device (enp3s0): Activation: failed for connection 'Wired connection 2'
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5099] device (enp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5143] dhcp4 (enp3s0): canceled DHCP transaction
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5144] dhcp4 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5144] dhcp4 (enp3s0): state changed no lease
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5163] policy: auto-activating connection 'Wired connection 2' (8ac7461d-f2f6-323c-a77f-528c60bb7884)
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5169] device (enp3s0): Activation: starting connection 'Wired connection 2' (8ac7461d-f2f6-323c-a77f-528c60bb7884)
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5170] device (enp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.5172] device (enp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Feb 10 11:29:37 minipc systemd[1]: Starting NetworkManager-dispatcher.service - Network Manager Script Dispatcher Service...
Feb 10 11:29:37 minipc onedriver[2597]: 11:29:37 INF Fetched 0 deltas.
Feb 10 11:29:37 minipc onedriver[2597]: 11:29:37 DBG Serializing cache metadata to disk.
Feb 10 11:29:37 minipc audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 10 11:29:37 minipc systemd[1]: Started NetworkManager-dispatcher.service - Network Manager Script Dispatcher Service.
Feb 10 11:29:37 minipc audit[1130]: NETFILTER_CFG table=firewalld:157 family=1 entries=6 op=nft_unregister_rule pid=1130 subj=system_u:system_r:firewalld_t:s0 comm="firewalld"
Feb 10 11:29:37 minipc audit[1130]: NETFILTER_CFG table=firewalld:158 family=1 entries=6 op=nft_register_rule pid=1130 subj=system_u:system_r:firewalld_t:s0 comm="firewalld"
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.6897] device (enp3s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.6903] device (br0): bridge port enp3s0 was attached
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.6903] device (enp3s0): Activation: connection 'Wired connection 2' enslaved, continuing activation
Feb 10 11:29:37 minipc NetworkManager[1368]: <info>  [1707586177.6906] dhcp4 (enp3s0): activation: beginning transaction (timeout in 45 seconds)