Ubuntu 18.04. Sudden DSL connection degrading - on and off - inconsistent slow connection to websites

Solution 1:

Change /etc/network/interfaces...

From:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
mtu 1450

To this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

Change your Wired Connection profile...

Because of DSL, change MTU from automatic, 1500, or whatever it is, to 1492.

enter image description here

Reboot and retest.

Update #1:

Note: I placed this here just in case it's required to manually determine that 1492 is the correct setting. First reset MTU to 1500, reboot, and then follow the instructions.

Your problem is with the MTU setting for your DSL connection.

There's a MTU setting in Ubuntu's network configuration, and a WAN MTU setting in your router.

For DSL, a common MTU setting is 1492. Just go ahead and try this value first and see if your web sites are now accessible.

To determine the correct setting, start with all MTU settings = 1500 and VPN = off. (VPN requires different testing).

In the terminal:

    ping [-c count] [-M do] [-s packet_size] [host]

The options used are:

  • c count: number of times to ping
  • M hint: Select Path MTU Discovery strategy. may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
  • s packet_size: Specifies the number of data bytes to be sent.

You should always start at 1472 and work your way down by 10 each time. Once you get a reply, go up by 1 until you get a fragmented packet. Take that value (last good value) and add 28 to the value to account for the various TCP/IP headers. Eg. let's say that 1452 was the proper packet size (where you first got an ICMP reply to your ping). The actual MTU size would be 1480, which is the optimum for the network we're working with.

    ping -c 4 -M do -s 1472 8.8.8.8 # this will probably show fragmentation

    ping -c 4 -M do -s 1462 8.8.8.8 # may show fragmentation

    ping -c 4 -M do -s 1452 8.8.8.8 # no fragmentation?

    ping -c 4 -M do -s 1453 8.8.8.8 # still no fragmentation?

reference: How to determine the proper MTU size with ICMP pings