redhat

How To Change MTU Size In CentOS and Linux

I ran into an issue with LDAP replication failing for some our remote sites in South Africa. After some troubleshooting, it looks like the local ISP is restricting MTU. In order to resolve the dropped packet issues and make LDAP replication possible, we had to change the MTU on our local servers sending the packets.

This has to be done at the source, not just at the router/firewall. I’ve read that it’s best if they do match however. For instance, if you set the MTU to 1300 on the ethernet port, set the MTU to 1300 on the firewall. If you set the MTU at the firewall to 1300 and not the source, packet loss will still occur.

I did some basic troubleshooting to find the issue using a ping variation:
ping mydomain.com -f -l 1472

Pinging mydomain.com [172.16.61.1] with 1472 bytes of data:

Reply from 10.0.10.1:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for 172.16.61.1:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

 

Solution: Permanently change MTU size on VM (my ping test gave me good results with 1300)

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

Output:
DEVICE=eth0
TYPE=Ethernet
UUID=76a8c659-2a7e-459f-abf2-e81230a2ece5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
#HWADDR=06:74:8A:00:17:D9 # Commented by Clonezilla
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″

add a setting
MTU=”1300″

Esc
:wq!

Restart network service
service network restart

Verify change took
vi /etc/sysconfig/network-scripts/ifcfg-eth0

Output:
DEVICE=eth0
TYPE=Ethernet
UUID=76a8c659-2a7e-459f-abf2-e81230a2ece5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
#HWADDR=06:74:8A:00:17:D9 # Commented by Clonezilla
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
MTU=”1300″
IPV6INIT=no
NAME=”System eth0″

After trying ping again, I received a good ping

 

 

After re-initializing my LDAP replication, it started and completed with no problem.