Every few minutes or so the connection to the network completely drops for several seconds. I can see this in nload
when there is no incoming or outgoing data for a few seconds even while running something like a Minecraft server for a constant network load. I know it is not the network because all of my other computers work fine even when this computer disconnects.
Here is the output of lspci
:
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
I have tried installing the r8168 drivers, but those didn't seem to help, I also have tried reinstalling network manager and setting managed to true in the config but no luck.
I can see the connection and use it for a few minutes, it just disconnects for a few seconds and then reconnects like nothing happened, causing any network services to lag or time out. I am currently running Ubuntu 21.04 but this issue happened on 20.04 and 20.10 as well.
Edit:
lspci -nn | grep -i ethernet
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
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:02:00.0
logical name: enp2s0
version: 0c
serial: 20:12:9d:20:02:6e
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.11.0-18-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.0.240 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:18 ioport:e800(size=256) memory:fbdff000-fbdfffff memory:f8ffc000-f8ffffff
ip a | grep mtu
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
Logs for an instance of this happening
Jun 14 21:31:16 server NetworkManager[810]: <info> [1623724276.7620] device (enp2s0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
Jun 14 21:31:16 server NetworkManager[810]: <info> [1623724276.7770] dhcp4 (enp2s0): canceled DHCP transaction
Jun 14 21:31:16 server NetworkManager[810]: <info> [1623724276.7770] dhcp4 (enp2s0): state changed bound -> done
Jun 14 21:31:16 server NetworkManager[810]: <info> [1623724276.7970] manager: NetworkManager state is now DISCONNECTED
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1803] device (enp2s0): carrier: link connected
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1806] device (enp2s0): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1815] policy: auto-activating connection 'netplan-enp2s0' (7ea6f90b-3495-3533-948a-ef0035687c34)
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1821] device (enp2s0): Activation: starting connection 'netplan-enp2s0' (7ea6f90b-3495-3533-948a-ef0035687c34)
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1823] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1828] manager: NetworkManager state is now CONNECTING
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1830] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1836] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:17 server NetworkManager[810]: <info> [1623724277.1840] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.1925] dhcp4 (enp2s0): state changed unknown -> bound, address=192.168.0.240
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.1943] device (enp2s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.1985] device (enp2s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.1989] device (enp2s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.1996] manager: NetworkManager state is now CONNECTED_LOCAL
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.2017] manager: NetworkManager state is now CONNECTED_SITE
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.2019] policy: set 'netplan-enp2s0' (enp2s0) as default for IPv4 routing and DNS
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.2023] policy: set 'netplan-enp2s0' (enp2s0) as default for IPv6 routing and DNS
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.2031] device (enp2s0): Activation: successful, device activated.
Jun 14 21:31:19 server NetworkManager[810]: <info> [1623724279.2041] manager: NetworkManager state is now CONNECTED_GLOBAL
Seems like "carrier changed" is causing this, I will look into that.