I am not able access few sites, like slack.com. So I searched about it and found that there is some problem with my Ubuntu 16.04 system which is related to MTU. After trying some ping requests, I found that the data packets of size 1497 or more are not being sent. So to reconfigure the MTU, I used

sudo ifconfig enp7s0 mtu 1497

But as soon as I execute this command, my internet connection disconnects and fails to connect further. I am using a DSL Connection.

Please give some suggestions on how to resolve this issue.

  • What where MTU before you started fiddling with it ? And what browser are you using ?
    – Soren A
    Commented Jun 29, 2017 at 8:57
  • MTU:1500 . Though I mainly use Chrome, but that doesn't matter. The websites doesn't open in any browser, I have checked with firefox and opera. Commented Jun 29, 2017 at 11:19
  • A strange thing just happened! I was experimenting on different browsers, and suddenly it worked on Opera having VPN enabled. So, I think the problem is probabily something else, i.e not related to MTU. But the strange thing is, if there is some problem with my Internet Connection, then it shouldn't work on my Windows Machine, but it does! Any idea why is it so? @SorenA Commented Jun 29, 2017 at 14:28
  • What is the WAN MTU set for in your router?
    – heynnema
    Commented Jun 29, 2017 at 15:22
  • @heynnema How to get the WAN MTU? The initial MTU is set to 1500. Commented Jul 1, 2017 at 5:34

2 Answers 2


Reboot to get the original MTU size (1500) back ... or try to set it with sudo ifconfig enp7s0 mtu 1500 ... to restore netaccess.

Unless you have some unsupported / misconfigured vlan setup, MTU should not be the issue. MTU is negotiated between each set of computers and routers in the net and packages broken in sizes fitting the MTUs under way.


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 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 # this will probably show fragmentation

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

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

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .