Score:1

Preventing Network Interface from changing speed ubuntu server

jm flag

Currently i'm stuck in trying to make my server a reliable router. It keep dropping the connection randomly. After checking and debugging for some time, i finally find out the problem.

The connection drop only happened when my interface, either it's the WAN or LAN interface changing speed from 100mbps to 1gbps and vice versa. I can test the ping when it change the speed, either by using ethtool or it's own, the ping resulted around 700ms from normally 0-1ms which is enough to drop connection in online gaming/video call.

So my question is, is there a way to either:

  • Force the speed into 1gbps, not allowing it to change at all
  • Force the speed on 100mbps, then i will just use the line as dedicated internet, and i will give another network card for my file server
  • Better solution to my problem?

I have tried many things, including ethtool, but no luck.

Score:1
jm flag

So after several days digging, i finally found the issue. the issue wasn't:

  • bad cable
  • bad switch
  • bad NIC
  • or anything physical there

So actually, i'm using dnsmasq as the DNS and DHCP server for my home network. When you start dnsmasq, by default it will fail because the service of systemd-resolved is using same port 53 which is used by DNS. Many online guide on using dnsmasq is asking to just disable the systemd-resolved by using systemctl disable, but many source actually say that this service is very important for entire system and do it at your own risk.

So i decided to backup most of my home server settings, and then i reinstall the ubuntu and do some testing. In that testing on fresh system, i do find that the ethernet speed and negotiation are stable. So here my testing:

I tested that fresh system as only NAS for 1 day, without using it as DHCP and DNS server. PASS

I then reconfigure that system with dnsmasq but this time i dont disable systemd-resolved, but instead i follow the guide here: https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html.

  1. vim /etc/systemd/resolved.conf
  2. add DNSStubListener=no
  3. reboot system

And viola! now my home server work perfectly even better than my router, using my old gaming pc:

  • Gigabyte X79 UD3
  • i7 3820
  • 32GB Corsair Dominator 1600 C9
  • 4x4 TB HDD in raid z1
  • 1 NVMe for main purpose
  • 64GB Sandisk USB 3.2 as boot
  • Realtek 8125 PCIe 2.5gbe 4 port

And there we go!

Score:0
th flag

Speed changes usually indicate that the physical cable is bad, bent or otherwise broken. Please try another network cable first.

Hans Yulian avatar
jm flag
it's same with other known good cables, at 1000mbps also it works just fine, it just that it sometimes change speed to 100mbps when not being used, but the moment it's used to the 1gbps, it spent 700ms to change to to 1gbps, same with changing back to 100mbps
Claus Holm Christensen avatar
th flag
Trouble is, if you fix the speed, then the computer will just disconnect you instead of reducing speed. I'll assume that's worse.
Hans Yulian avatar
jm flag
Yes that happens too, but i notice that my windows machine always running on 1gbps all time with no issue, i can monitor this from my router. Cant ubuntu do the same?
Claus Holm Christensen avatar
th flag
Yes, Ubuntu will also do the same, if in any way possible. Have you tried swapping the ends of the network cable (it forces you to disconnect and re-route the cable)?
Hans Yulian avatar
jm flag
yes, i even tried to change to the know good cable, no luck
Claus Holm Christensen avatar
th flag
If the cable really is known good, then it must be something else. Did you try another outlet in the router? If not that, then look at the dmesg output for some details about the reasons for the speed change, but then I'm not really able to help you with the issue.
Hans Yulian avatar
jm flag
i found the issue, has been testing for 3 days and it's stable now, check my answer
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.