Signed-off-by: Patrick Hemmer <patrick.hemmer@gmail.com>
| ... | ... |
@@ -162,10 +162,6 @@ func detachMounted(path string) error {
|
| 162 | 162 |
return nil |
| 163 | 163 |
} |
| 164 | 164 |
|
| 165 |
-func getDefaultRouteMtu() (int, error) {
|
|
| 166 |
- return -1, errSystemNotSupported |
|
| 167 |
-} |
|
| 168 |
- |
|
| 169 | 165 |
func killProcessDirectly(container *container.Container) error {
|
| 170 | 166 |
return nil |
| 171 | 167 |
} |
| ... | ... |
@@ -1382,13 +1382,8 @@ func setDefaultMtu(config *Config) {
|
| 1382 | 1382 |
return |
| 1383 | 1383 |
} |
| 1384 | 1384 |
config.Mtu = defaultNetworkMtu |
| 1385 |
- if routeMtu, err := getDefaultRouteMtu(); err == nil {
|
|
| 1386 |
- config.Mtu = routeMtu |
|
| 1387 |
- } |
|
| 1388 | 1385 |
} |
| 1389 | 1386 |
|
| 1390 |
-var errNoDefaultRoute = errors.New("no default route was found")
|
|
| 1391 |
- |
|
| 1392 | 1387 |
// verifyContainerSettings performs validation of the hostconfig and config |
| 1393 | 1388 |
// structures. |
| 1394 | 1389 |
func (daemon *Daemon) verifyContainerSettings(hostConfig *runconfig.HostConfig, config *runconfig.Config) ([]string, error) {
|
| ... | ... |
@@ -33,7 +33,6 @@ import ( |
| 33 | 33 |
"github.com/docker/libnetwork/types" |
| 34 | 34 |
blkiodev "github.com/opencontainers/runc/libcontainer/configs" |
| 35 | 35 |
"github.com/opencontainers/runc/libcontainer/label" |
| 36 |
- "github.com/vishvananda/netlink" |
|
| 37 | 36 |
) |
| 38 | 37 |
|
| 39 | 38 |
const ( |
| ... | ... |
@@ -670,25 +669,6 @@ func (daemon *Daemon) conditionalUnmountOnCleanup(container *container.Container |
| 670 | 670 |
daemon.Unmount(container) |
| 671 | 671 |
} |
| 672 | 672 |
|
| 673 |
-// getDefaultRouteMtu returns the MTU for the default route's interface. |
|
| 674 |
-func getDefaultRouteMtu() (int, error) {
|
|
| 675 |
- routes, err := netlink.RouteList(nil, 0) |
|
| 676 |
- if err != nil {
|
|
| 677 |
- return 0, err |
|
| 678 |
- } |
|
| 679 |
- for _, r := range routes {
|
|
| 680 |
- // a nil Dst means that this is the default route. |
|
| 681 |
- if r.Dst == nil {
|
|
| 682 |
- i, err := net.InterfaceByIndex(r.LinkIndex) |
|
| 683 |
- if err != nil {
|
|
| 684 |
- continue |
|
| 685 |
- } |
|
| 686 |
- return i.MTU, nil |
|
| 687 |
- } |
|
| 688 |
- } |
|
| 689 |
- return 0, errNoDefaultRoute |
|
| 690 |
-} |
|
| 691 |
- |
|
| 692 | 673 |
func restoreCustomImage(driver graphdriver.Driver, is image.Store, ls layer.Store, ts tag.Store) error {
|
| 693 | 674 |
// Unix has no custom images to register |
| 694 | 675 |
return nil |
| ... | ... |
@@ -16,7 +16,7 @@ The information in this section explains how to customize the Docker default bri |
| 16 | 16 |
|
| 17 | 17 |
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. |
| 18 | 18 |
|
| 19 |
-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: |
|
| 19 |
+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 1,500 bytes. These options are configurable at server startup: |
|
| 20 | 20 |
- `--bip=CIDR` -- supply a specific IP address and netmask for the `docker0` bridge, using standard CIDR notation like `192.168.1.5/24`. |
| 21 | 21 |
|
| 22 | 22 |
- `--fixed-cidr=CIDR` -- restrict the IP range from the `docker0` subnet, using the standard CIDR notation like `172.167.1.0/28`. This range must be an IPv4 range for fixed IPs (ex: 10.20.0.0/16) and must be a subset of the bridge IP range (`docker0` or set using `--bridge`). For example with `--fixed-cidr=192.168.1.0/25`, IPs for your containers will be chosen from the first half of `192.168.1.0/24` subnet. |