2015-10-12 22:19:25 +00:00
|
|
|
package libnetwork
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/docker/libnetwork/drivers/bridge"
|
|
|
|
)
|
|
|
|
|
2016-11-04 20:26:50 +00:00
|
|
|
const libnGWNetwork = "docker_gwbridge"
|
|
|
|
|
|
|
|
func getPlatformOption() EndpointOption {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-10-12 22:19:25 +00:00
|
|
|
func (c *controller) createGWNetwork() (Network, error) {
|
|
|
|
netOption := map[string]string{
|
|
|
|
bridge.BridgeName: libnGWNetwork,
|
|
|
|
bridge.EnableICC: strconv.FormatBool(false),
|
|
|
|
bridge.EnableIPMasquerade: strconv.FormatBool(true),
|
|
|
|
}
|
|
|
|
|
2016-02-29 19:49:04 +00:00
|
|
|
n, err := c.NewNetwork("bridge", libnGWNetwork, "",
|
2016-01-30 00:54:57 +00:00
|
|
|
NetworkOptionDriverOpts(netOption),
|
|
|
|
NetworkOptionEnableIPv6(false),
|
|
|
|
)
|
2015-10-12 22:19:25 +00:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
|
|
|
}
|
|
|
|
return n, err
|
|
|
|
}
|