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