Home > English, Tech Crunch > HOWTO Change the MTU of an interface on Debian

HOWTO Change the MTU of an interface on Debian

This article was first written in September 2005 for the BeezNest technical
website (http://glasnost.beeznest.org/articles/290).

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, where almost all network parameters are found. To do this, just add a line mtu to the definition of your interface. 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

There is an exception, though.

Warning: the following is mostly obsolete in Sid and Etch

It seems that the dhcp clients are not configured by default to do the same for dynamically-assigned configurations [1]. 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

[1] see DBTS #294044, and DBTS #333519, and DBTS #309205 for more information

Advertisements
Categories: English, Tech Crunch Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: