本文所述内容是针对旧版本docker(doker 1.10版本以下不包括1.10版本)
docker mtu
By default, the Docker server creates and configures the host system’s docker0 interface as an Ethernet bridge inside the Linux kernel that can pass packets back and forth between other physical or virtual network interfaces so that they behave as a single Ethernet network.
==启动docker时==,docker服务器会在内核中创建一个docker0网卡接口作为网桥,通过此网桥,虚拟网卡和物理网卡之间可以互相传输数据包。
Docker configures docker0 with an IP address, netmask and IP allocation range. The host machine can both receive and send packets to containers connected to the bridge, and gives it an MTU – the maximum transmission unit or largest packet length that the interface will allow – of either 1,500 bytes or else a more specific value copied from the Docker host’s interface that supports its default route. These options are configurable at server startup:
具体的,docker会为docker0配置一个IP地址、子网掩码和ip地址池,物理机可以与连接到docker0的任何容器传输数据。同时设置docker0的mtu值为1500或者宿主机默认网卡的mtu值(==docker1.10以下版本==)。这些工作在docker启动时进行。
Once you have one or more containers up and running, you can confirm that Docker has properly connected them to the docker0 bridge by running the brctl command on the host machine and looking at the interfaces column of the output. Here is a host with two different containers connected:
一旦启动一个容器,docker便会将这个容器连接到docker0上。可通过sudo brctl show
命令查看1
2
3
4$ sudo brctl show
bridge name bridge id STP enabled interfaces
docker0 8000.3a1d7362b4ee no veth65f9
vethdda6