|
@@ -1008,11 +1008,11 @@ func initBridgeDriver(controller libnetwork.NetworkController, config *config.Co
|
|
|
}
|
|
|
|
|
|
if config.BridgeConfig.IP != "" {
|
|
|
- ipamV4Conf.PreferredPool = config.BridgeConfig.IP
|
|
|
- ip, _, err := net.ParseCIDR(config.BridgeConfig.IP)
|
|
|
+ ip, ipNet, err := net.ParseCIDR(config.BridgeConfig.IP)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ ipamV4Conf.PreferredPool = ipNet.String()
|
|
|
ipamV4Conf.Gateway = ip.String()
|
|
|
} else if bridgeName == bridge.DefaultBridgeName && ipamV4Conf.PreferredPool != "" {
|
|
|
logrus.Infof("Default bridge (%s) is assigned with an IP address %s. Daemon option --bip can be used to set a preferred IP address", bridgeName, ipamV4Conf.PreferredPool)
|