2015-10-12 22:19:25 +00:00
|
|
|
package libnetwork
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
|
2021-04-06 00:24:47 +00:00
|
|
|
"github.com/docker/docker/libnetwork/drivers/bridge"
|
2015-10-12 22:19:25 +00:00
|
|
|
)
|
|
|
|
|
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
|
|
|
|
}
|