How to set MTU size for a Network Interface in Redhat Enterprise Linux(RHEL)

The Maximum Transmission Unit (MTU) can be set/modified in real time on Redhat Enterprise Linux or can be set force the value at boot time.

The MTU in simple terms is the maximum size of a packet that can be sent on a Network Interface card. The default MTU size is 1500 bytes.

To dynamically change the MTU in real time while the server is in use,

redhatlinux# ip link set dev eth0 mtu 1350

where eth0 is the Ethernet interface and 1350 is the mtu size (1350 bytes)

However, this change is lost when the server or the network interface restarts the next time.

To make the change permanent, edit the interface configuration file (for instance eth0)

/etc/sysconfig/network-scripts/ifcfg-eth0

and add the following line

MTU=1350

so a cat of the file should look something like this

redhatlinux# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
MTU=1350
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet

Once done, simply restart the interface or reboot the server at the next available maintenance window for the changes to take effect.

To restart the Network Interface

redhatlinux# service network restart eth0

To view the updated MTU

redhatlinux# ip link list
1: lo:  mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1350 qdisc pfifo_fast qlen 1000
    link/ether 00:01:11:12:13:14 brd ff:ff:ff:ff:ff:ff
3: eth1:  mtu 1500 qdisc noop qlen 1000
    link/ether 00:40:f4:98:8e:43 brd ff:ff:ff:ff:ff:ff

or

redhatlinux# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:01:11:12:13:14
          inet addr:192.168.10.11  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1350  Metric:1
          RX packets:12321 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6610 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:201126104 (194.1 MiB)  TX bytes:78293 (768.8 KiB)
          Interrupt:209 Memory:fb000000-0

Comments

One response to “How to set MTU size for a Network Interface in Redhat Enterprise Linux(RHEL)”

  1. Jeremy Avatar
    Jeremy

    Simple and efficient, thanks!

Leave a Reply

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