August 12, 2008 · Networking · Email This Post
Share

If you're new here, you may want to subscribe to my RSS feed and if you have questions related to your ubuntu system post question to our forums. Thanks for visiting!

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

Example

iface eth0 inet static
address 192.168.0.1
network 192.168.0.0
gateway 192.168.0.254
netmask 255.255.255.0
mtu 1492

Daiup Users

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

  • Share/Bookmark

Related Articles

7 Comments to “How to Change MTU (Maximum Transmission Unit) of network interface in Ubuntu Linux”

  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 http://www.debianadmin.org 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 74.126.24.86
    1: Mugglewille-desktop.local (192.168.1.3) 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
    ^C

    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 ?

Leave a Reply