Page 1 of 2

Wired connection stops working after a while

Posted: 2024-02-24 12:36
by ouroboros
Hi. A new Debian user here.

I have installed Debian 12 stable on my laptop which previously ran Windows 10 without any problems. Now I'm having trouble with wired network connection. I use Connman network manager as it came with LXQT. There was network-manager package installed but I removed it to avoid interference.

The problem is that when I boot up my laptop wired connection works for a while and then stops working, pinging doesn't work. I could then go to Connman UI and restart the connection and It would work again for a while. Now this doesn't work anymore. Now I have to reboot pc to get wired connection to work for, again for just a while (4-5 mins).

If I try sudo ifdown eno1 and then sudo ifup eno1 I get:

Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eno1/c4:65:16:a4:71:67
Sending on LPF/eno1/c4:65:16:a4:71:67
Sending on Socket/fallback
DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 7

My /etc/network/interfaces:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
allow-hotplug eno1
iface eno1 inet dhcp

systemctl --failed outputs:

UNIT LOAD ACTIVE SUB DESCRIPTION
● networking.service loaded failed failed Raise network interfaces

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed.

When I try sudo systemctl restart networking.service It takes a while and when I check sudo systemctl status networking.service I get:

● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; preset: enabled)
Active: active (exited) since Sat 2024-02-24 13:19:00 CET; 16s ago
Docs: man:interfaces(5)
Process: 113529 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
Process: 115398 ExecStart=/bin/sh -c if [ -f /run/network/restart-hotplug ]; then /sbin/ifup -a --read-environment --allow=hotplug; fi (code=exited, status=0/SUCCESS)
Main PID: 115398 (code=exited, status=0/SUCCESS)
Tasks: 3 (limit: 9152)
Memory: 1.3M
CPU: 140ms
CGroup: /system.slice/networking.service
├─113552 dhclient -4 -v -i -pf /run/dhclient.eno1.pid -lf /var/lib/dhcp/dhclient.eno1.leases -I -df /var/lib/dhcp/dhclient6.eno1.leases eno1
├─115378 "avahi-autoipd: [eno1] sleeping"
└─115379 "avahi-autoipd: [eno1] callout dispatcher"

Feb 24 13:19:00 Debian dhclient[113552]: No DHCPOFFERS received.
Feb 24 13:19:00 Debian ifup[113552]: No DHCPOFFERS received.
Feb 24 13:19:00 Debian ifup[113552]: No working leases in persistent database - sleeping.
Feb 24 13:19:00 Debian dhclient[113552]: No working leases in persistent database - sleeping.
Feb 24 13:19:00 Debian avahi-autoipd(eno1)[115378]: Found user 'avahi-autoipd' (UID 101) and group 'avahi-autoipd' (GID 110).
Feb 24 13:19:00 Debian avahi-autoipd(eno1)[115378]: Successfully called chroot().
Feb 24 13:19:00 Debian avahi-autoipd(eno1)[115378]: Successfully dropped root privileges.
Feb 24 13:19:00 Debian avahi-autoipd(eno1)[115378]: Starting with address 169.254.10.0
Feb 24 13:19:00 Debian avahi-autoipd(eno1)[115378]: Routable address already assigned, sleeping.
Feb 24 13:19:00 Debian systemd[1]: Finished networking.service - Raise network interfaces.

At least wifi still works. Though sometimes I have to reconfigure /etc/resolve.conf to add DNS back in since for some reason the lines get removed. I also had some trouble with networking.service with regards to wpasupplicant.

I should mention that this is a second installation. First installation had GNOME and came with NetworkManager and had same connection issues.

I would be very grateful for any help. I really want to make linux my daily driver.

Thank you for your time.

Re: Wired connection stops working after a while

Posted: 2024-02-24 15:13
by wizard10000
If you're running connman you should *not* have an entry for your network card in /etc/network/interfaces. Suggest commenting out the eno1 section of the file and then reboot the machine. Does this resolve the issue?

Re: Wired connection stops working after a while

Posted: 2024-02-24 18:00
by ouroboros
Tried It. It doesn't work. When I power on the connection It doesn't even get connected. Before It at least said it's connected. Maybe I need to somehow configure the connection specifically for Connman? I tried this https://manpages.debian.org/testing/con ... .5.en.html. But directory /var/lib/connman contains nothing ending in .conf. I found some directories that are referring to connection names which I see in Connman UI: ethernet_c46516a47167_cable. When I try to get in by sudo cd ethernet_c46516a47167-cable I get:

sudo: cd: command not found
sudo: "cd" is a shell built-in command, it cannot be run directly.
sudo: the -s option may be used to run a privileged shell.
sudo: the -D option may be used to run a command in a specific directory.

Also tried resetting the connman.service but no effect.

Re: Wired connection stops working after a while

Posted: 2024-02-24 18:28
by wizard10000
ouroboros wrote: 2024-02-24 18:00...Maybe I need to somehow configure the connection specifically for Connman?
You shouldn't have to touch anything in /var for connman to work. Run connman settings (either connman-gtk or cmst, depending on what you have installe) and ensure the Ethernet card is enabled.

Re: Wired connection stops working after a while

Posted: 2024-02-24 18:53
by ouroboros
Should I make sure the Ethernet card is enabled in cmst (which I have installed) or should I enable it some other way?

Code: Select all

eno1: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet6 fe80::c665:16ff:fea4:7167  prefixlen 64  scopeid 0x20<link>
        ether c4:65:16:a4:71:67  txqueuelen 1000  (Ethernet)
        RX packets 24  bytes 1628 (1.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 146  bytes 24721 (24.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Re: Wired connection stops working after a while

Posted: 2024-02-24 19:27
by wizard10000
ouroboros wrote: 2024-02-24 18:53Should I make sure the Ethernet card is enabled in cmst
Yep :)

Re: Wired connection stops working after a while

Posted: 2024-02-24 19:57
by ouroboros
There is no such option in cmst UI. I've found this https://github.com/Ultimaker/connman/blob/master/README but cannot make it work.

Re: Wired connection stops working after a while

Posted: 2024-02-25 12:21
by wizard10000
I also use cmst and the toggle you're looking for is on the main screen under "Technologies". Does your Ethernet adapter show up there? If so, is "Powered" set to "on"?

Re: Wired connection stops working after a while

Posted: 2024-02-25 12:29
by ouroboros
I removed cmst and connman packages completely. Used network-manager and NetworkManager applet after that and wired connection started working and it doesn't stop. Only issue is that ifconfig shows only IPv6(inet6) address without IPv4 (intet). And I noticed that some websites (reddit.com, ubuntuforums.com) don't load on wired connection while they load fine over WiFi which has IPv4 address.

Re: Wired connection stops working after a while

Posted: 2024-02-25 13:59
by arzgi
ouroboros wrote: 2024-02-25 12:29 I removed cmst and connman packages completely. Used network-manager and NetworkManager applet after that and wired connection started working and it doesn't stop. Only issue is that ifconfig shows only IPv6(inet6) address without IPv4 (intet). And I noticed that some websites (reddit.com, ubuntuforums.com) don't load on wired connection while they load fine over WiFi which has IPv4 address.
To get wired working, you should not need connman or NetworkManager.

You can disable ipv6 from your router, or from your pc/laptop

Code: Select all

Way 1.
You can disable the IPv6 stack with the ipv6.disable=1 kernel command line    parameter.

Way 2.
1. create  /etc/sysctl.d/10-disable-ipv6.conf
and the content:
	net.ipv6.conf.all.disable_ipv6 = 1

apply the config
$ sudo systemctl restart systemd-sysctl

 check addresses
$ ip -6 addr show
$ ip -4 addr show

Re: Wired connection stops working after a while

Posted: 2024-02-25 14:20
by ouroboros
I did the above. Ethernet still only has ipv6.

Re: Wired connection stops working after a while

Posted: 2024-02-25 14:22
by arzgi
ouroboros wrote: 2024-02-25 14:20 I did the above. Ethernet still only has ipv6.
Which? I gave two ways. Try to reboot.

It might be that the ipv6 address you get is the only, no ipv4. To migitate that you have to change your router settings. I always do that, I have no use of Ipv6 in my LAN:

Re: Wired connection stops working after a while

Posted: 2024-02-25 15:59
by ouroboros
I'm sorry. I did the second option. Don't know how to perform first. I created the file and added the line. Then restarted systemd-sysctl. Checked for ip6 and ip4. Found eno1 only has ip6. Then rebooted. Checked ip. Still the same.

I don't know how to edit router settings on linux. I'm not sure I even have router. I never had to touch router settings when I was on windows. I also remember that on windows I had address of the form x.x.x.x where x are natural numbers (with zero). The only thing I have is a managed switch (https://www.t-2.net/sites/www.t2.si/fil ... me801g.pdf). Again, I never had to touch this thing software-wise.

Maybe there are services running which are interfering with NetworkManager? How could I list all of the apps/services that manage networks that are installed on my pc?

I think it has something to do with dhcp denying me service for ipv4. I dunno.

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:07
by ouroboros
Just tried setting a static ipv4 address. It works but it's sooo slow.

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:08
by arzgi
DHCP can't change ipv6 to ipv4.

If you follow the cable from your NIC where is the other end?

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:10
by arzgi
ouroboros wrote: 2024-02-25 16:07 Just tried setting a static ipv4 address. It works but it's sooo slow.
That does not help, if your LAN is ipv6 only.

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:15
by ouroboros
If you follow the cable from your NIC where is the other end?
I have a cat5 cable going from my laptop to a managed switch. Fiber-optic cable goes out the switch and on.

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:16
by arzgi
ouroboros wrote: 2024-02-25 16:15
If you follow the cable from your NIC where is the other end?
I have a cat5 cable going from my laptop to a managed switch. Fiber-optic cable goes out the switch and on.
OK, you had managed switch, if it can't do NAT, you have to buy a router which can do it. Or live with ipv6, it is one solution.

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:30
by ouroboros
Switch is not a problem. It is managed but it is not really managed. I looked at the manual: to manage it you have to connect your pc to it via a separate connection which is not a cat5 cable. I didn't have problems with the connection when I was on windows. And changed nothing when switching to Debian. It has to be Debian. It's giving me trouble from the beginning.

How can I check whether dhcp works on my pc? Are there two different dhcp services, one for ipv4 and one for ipv6?

Re: Wired connection stops working after a while

Posted: 2024-02-25 16:35
by arzgi
ouroboros wrote: 2024-02-25 16:30 Switch is not a problem. It is managed but it is not really managed. I looked at the manual: to manage it you have to connect your pc to it via a separate connection which is not a cat5 cable. I didn't have problems with the connection when I was on windows. And changed nothing when switching to Debian. It has to be Debian. It's giving me trouble from the beginning.

How can I check whether dhcp works on my pc? Are there two different dhcp services, one for ipv4 and one for ipv6?
You said wifi gets ipv4, whits device creates the wifi? DHCP accepts just what it gets.