2015-10-12 18:19:25 -04:00
|
|
|
package libnetwork
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
|
2021-04-05 20:24:47 -04:00
|
|
|
"github.com/docker/docker/libnetwork/drivers/bridge"
|
2015-10-12 18:19:25 -04:00
|
|
|
)
|
|
|
|
|
2016-11-04 16:26:50 -04:00
|
|
|
const libnGWNetwork = "docker_gwbridge"
|
|
|
|
|
|
|
|
func getPlatformOption() EndpointOption {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-10-12 18:19:25 -04: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 14:49:04 -05:00
|
|
|
n, err := c.NewNetwork("bridge", libnGWNetwork, "",
|
2016-01-29 19:54:57 -05:00
|
|
|
NetworkOptionDriverOpts(netOption),
|
|
|
|
NetworkOptionEnableIPv6(false),
|
|
|
|
)
|
2015-10-12 18:19:25 -04:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
|
|
|
}
|
|
|
|
return n, err
|
|
|
|
}
|