2016-03-04 17:13:12 -05:00
|
|
|
package libnetwork
|
|
|
|
|
2016-10-17 16:29:10 -04:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/docker/libnetwork/drivers/solaris/bridge"
|
|
|
|
)
|
2016-03-04 17:13:12 -05:00
|
|
|
|
2016-11-04 16:26:50 -04:00
|
|
|
const libnGWNetwork = "docker_gwbridge"
|
|
|
|
|
|
|
|
func getPlatformOption() EndpointOption {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-03-04 17:13:12 -05:00
|
|
|
func (c *controller) createGWNetwork() (Network, error) {
|
2016-10-17 16:29:10 -04:00
|
|
|
netOption := map[string]string{
|
|
|
|
bridge.BridgeName: libnGWNetwork,
|
|
|
|
bridge.EnableICC: strconv.FormatBool(false),
|
|
|
|
bridge.EnableIPMasquerade: strconv.FormatBool(true),
|
|
|
|
}
|
|
|
|
|
|
|
|
n, err := c.NewNetwork("bridge", libnGWNetwork, "",
|
|
|
|
NetworkOptionDriverOpts(netOption),
|
|
|
|
NetworkOptionEnableIPv6(false),
|
|
|
|
)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("error creating external connectivity network: %v", err)
|
|
|
|
}
|
|
|
|
return n, err
|
2016-03-04 17:13:12 -05:00
|
|
|
}
|