Docker MTU Configuration
  • 1 Minute to read

    Docker MTU Configuration


      Article Summary

      When using Docker with NordLayer you may experience connectivity issues which are caused by how Docker is configuring the MTU or by the network path itself not supporting Path MTU Discovery.

      To resolve this problem, you would need to reconfigure the MTU on the Docker network interface.

      In this guide, we use 1420 as the MTU value, but generally the MTU depends on the Network that is being used to connect to the NordLayer service and the encryption protocol. The lowest value for MTU that has been tested to work is 1280.

      1. To start with, connect to the NordLayer private or shared gateway and open ​​Docker Command Line Interface (CLI) to find out the network interface name by using the ip command:
      $ ip route get 1.1.1.1
      

      You will get an output similar to this:

      1.1.1.1 dev nlx0 table 51820 src 10.6.12.2 uid 1000
      

      Based on the results, our interface is nlx0, but yours may differ.

      1. To display the size of MTU that is locally configured on your interface, enter the following command together with the correct interface from Step 1:
      $ ip link | grep nlx0
      

      You will get an output similar to this:

      7: nlx0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1420 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 500
      
      1. To finish the configuration, please edit the file /etc/docker/daemon.json and enter the MTU size of your interface:
      {
         "mtu":1420
      }
      

      Solving the problem on Docker-Compose

      If you are using docker-compose, the MTU needs to be set additionally in the docker-compose.yml file:

      version: "3"
      
      services:
        app:
          image: acme/app
        networks:
          - my-net
      
      networks:
        my-net:
          driver: bridge
          driver_opts:
            com.docker.network.driver.mtu: 1420
      

      Note: In case you have any questions or are experiencing any issues, please feel free to contact our 24/7 customer support team.


      Was this article helpful?