Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

  • RSS Feed

    subscribe to the Debian Admin RSS feed
  • Sponsors



    • Cheap Web hosting services
  • Categories

  • Meta

  • Support Debian Admin

    Amount $:
    Website(Optional):

  • Sponsors

  • Archives



Change MTU (Maximum Transmission Unit) of network interface

Posted by Admin on October 14th, 2006

If you're new here, you may want to subscribe to my RSS feed. 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 tell ifconfig to do so, like this for example:

#/sbin/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.

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

Warning: the following is mostly obsolete in Debian Sid and Etch

It seems that the dhcp clients are not configured by default to do the same for dynamically assigned configurations . So, you need to use a tweak to achieve the same. We’re going to use the pre-up feature of /etc/network/interfaces like this:

iface eth0 inet dhcp
hostname “mymachine”
name LAN Interface
pre-up /sbin/ifconfig $IFACE mtu 1492

More common Recommended Values

Dial-up Connections - 576 Bytes
PPPoE Broadband Connections - 1492 Bytes
Ethernet, DSL and Cable Broadband Connections - 1500 Bytes

Share/Save/Bookmark

One Response to “Change MTU (Maximum Transmission Unit) of network interface”

  1. Arjan Says:

    pre-up /sbin/ifconfig $IFACE mtu 1492

    You might like using post-up instead.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
Rodney's Kontera DynamiContext Plugin plugged in.