How to Change MTU (Maximum Transmission Unit) of network interface in Ubuntu Linux

Sponsored Link
Maximum Transmission Unit(MTU), the largest physical packet size, measured in bytes, that a network can transmit. Any messages larger than the MTU are divided into smaller packets before being sent.By optimizing the MTU setting you can gain substantial network performance increases, especially when using dial-up modem connections.

Default MTU Size for Different Network Topology

Network MTU(Bytes)
16 Mbit/Sec Token Ring 17914
4 Mbits/Sec Token Ring 4464
FDDI 4352
Ethernet 1500
IEEE 802.3/802.2 1492
X.25 576

To change the MTU of an interface on GNU/Linux, you just need to use ifconfig command to do so, like this for example

sudo ifconfig eth0 mtu 1492

To change it permanently on Debian, put it in the /etc/network/interfaces file .where almost all network parameters are found. To do this, just add a line mtu to the definition of your interface and save the file.

sudo gedit /etc/network/interfaces


iface eth0 inet static
mtu 1492

Daiup Users

For dialup users: the Maximum Transmission Unit (MTU) value can be changed within the file

Sponsored Link

You may also like...

12 Responses

  1. Peter says:

    Well ok fine … that tells you how to change the MTU.

    But what it does not tell you is how to find out whether you need to change your settings to 1300 or 1600 or whatever….. it cannot be simply trial and error. I hope.

    1492 or 1500 seem to be the common defaults but there is never an explanation of what they could / should be …

  2. jj says:

    from what I found on after Googling, settings for a static (not necessarily a dynamic [DHCP])address should be:

    dialup 576
    DSL 1492
    cable modem 1500
    fiber 4352

  3. Marco says:

    Use the command tracepath to know the suitable MTU of your network

  4. Kyle Ragln says:

    The MTU becomes more important for people using Gigabit Ethernet. To get the best throughput (and if your switch supports it), it’s best to use “Jumbo” frames. Jumbo frames are enabled with an MTU of around 9000. Not all Gigabit Ethernet NICs support an MTU of 9000. As an example, my Realtek 8169 based card supports a maximum of 7200. Even at only 7200, transferring files between the computers on my LAN happens much faster than when using the default MTU of 1500. Of course, it’s best to check and see what the manufacturer suggests as the maximum supported MTU for the particular NIC you’re using.

  5. Arup Roy Chowdhury says:

    With Intrepid, the network manager has a tab for MTU setting and does it well, whoever thought about this, my hats off to him for incorporating this nifty feature.

  6. shirish says:

    Hi all,
    It seems tracepath does give what is suitable.

    $ tracepath
    1: Mugglewille-desktop.local ( 0.355ms pmtu 1500
    1: no reply
    2: no reply
    3: no reply
    4: no reply
    5: no reply
    6: no reply
    7: no reply
    8: no reply
    9: no reply

    So seems it is saying the best mtu is 1500

  7. Steve says:

    I can’t get ‘mtu size’ to work for eth0 when it has a dynamic IP address. The manual for interfaces describes the ‘mtu size’ option for static IP addresses, as are used above. I’m running Ubuntu 8.04 LTS server.

    Is this a bug ?

  8. jk says:

    To find out MTU you can do a ping to any destination, set the DF bit to 1 (Dont Fragment) and play around with the packet size until you find a limit that works.

    To do this in ubuntu:
    ping -Mdo -s 1500

    -Mdo sets DF to 1
    – s 1500 sets your buffer to 1500 bytes
    – is a destination IP

    The above command should return that the packet cant be fragmented or the message is too long (or similar). You then reduce the size of the packet (eg. -s 1490) until you get a reply. Then increase and reduce the number until you find the exact MTU you should use.

  9. jonny rocket says:

    BUT, what should it be set too?

  10. Neel says:

    Evolution mail, youtube-dl, PUBKEY and many more such tools aren’t working on my ubuntu 10.10, however my browser opens all the websites very normally. Can it be a problem with the MTU??
    I ran the command sudo ifconfig -a on the terminal and the output is as follows:

    eth0 Link encap:Ethernet HWaddr d8:d3:85:30:cf:33
    inet addr: Bcast: Mask:
    inet6 addr: fe80::dad3:85ff:fe30:cf33/64 Scope:Link
    RX packets:960 errors:0 dropped:0 overruns:0 frame:0
    TX packets:783 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1005736 (1.0 MB) TX bytes:90389 (90.3 KB)
    Interrupt:45 Base address:0xc000

    lo Link encap:Local Loopback
    inet addr: Mask:
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:4 errors:0 dropped:0 overruns:0 frame:0
    TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)

    pimreg Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    UP RUNNING NOARP MTU:1472 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    wlan0 Link encap:Ethernet HWaddr 70:f1:a1:55:b3:d4
    inet addr: Bcast: Mask:
    inet6 addr: fe80::72f1:a1ff:fe55:b3d4/64 Scope:Link
    RX packets:6 errors:0 dropped:0 overruns:0 frame:0
    TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:980 (980.0 B) TX bytes:6398 (6.3 KB)
    Interrupt:17 Memory:f87e0000-f87e0100.

    Please suggest appropriate changes.

  11. mark says:

    ok so im trying to get on xbox live and its telling me i need to change the mtu i have no idea how to do so can someone help me out with step by step directions

  12. Harry says:

    This was helpful. Ever since I switched to WIFI for my Ubuntu computer, yahoo mail wouldn’t work right. Also, other posting & replying functions in websites wouldn’t work right either as well as dropbox. It was driving me nuts. Following the advice here, I figured out the highest I could set MTU on the wireless connection was 1472. Everything now works like a charm!


Leave a Reply

Your email address will not be published. Required fields are marked *