How to change MTU size for bonding interface

Environment

  • Red Hat Enterprise Linux (All Versions)

Issue

  • To set MTU for a bond interface, is there a need to change MTU in all slave interface configuration files ? Or is changing the configuration of the bond enough ?

Resolution

  • The MTU need only be set on the bond device. This will be propagated to the slave interfaces.
  • To make the setting permanent for bondX, edit the configuration file /etc/sysconfig/network-scripts/ifcfg-bondX and add the following line:
MTU=<value>
  • Then, restart the network service:
# service network restart
[root@rhel7 ~]# grep MTU /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-bond0:MTU="9000"
/etc/sysconfig/network-scripts/ifcfg-eth0:MTU="9000"
/etc/sysconfig/network-scripts/ifcfg-eth1:MTU="9000"

[root@rhel7 ~]# systemctl restart network.service

[root@rhel7 ~]# ip addr show
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP 
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.136/24 brd 192.168.122.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe41:c14a/64 scope link tentative dadfailed 
       valid_lft forever preferred_lft forever

Diagnostic Steps

  • Check MTU values in output of command ifconfig -a.

No comments: