diff --git a/docker/docker.go b/docker/docker.go index 85bfc8e551..d38d67216c 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -27,7 +27,7 @@ func main() { if *bridgeName != "" { docker.NetworkBridgeIface = *bridgeName } else { - docker.NetworkBridgeIface = "lxcbr0" + docker.NetworkBridgeIface = docker.DefaultNetworkBridge } if *flDebug { os.Setenv("DEBUG", "1") diff --git a/network.go b/network.go index cde78e7aa6..105c0056f5 100644 --- a/network.go +++ b/network.go @@ -14,8 +14,9 @@ import ( var NetworkBridgeIface string const ( - portRangeStart = 49153 - portRangeEnd = 65535 + DefaultNetworkBridge = "lxcbr0" + portRangeStart = 49153 + portRangeEnd = 65535 ) // Calculates the first and last IP addresses in an IPNet diff --git a/runtime.go b/runtime.go index 97752a2ab5..0e5bcbfc69 100644 --- a/runtime.go +++ b/runtime.go @@ -267,6 +267,9 @@ func NewRuntimeFromDirectory(root string) (*Runtime, error) { if err != nil { return nil, fmt.Errorf("Couldn't create Tag store: %s", err) } + if NetworkBridgeIface == "" { + NetworkBridgeIface = DefaultNetworkBridge + } netManager, err := newNetworkManager(NetworkBridgeIface) if err != nil { return nil, err