1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Merge pull request #6371 from jpetazzo/6370-masquerade

Select masquerade by outgoing interface rather than by destination subne...
Upstream-commit: bcec0f30e8d7dbb9fcdd6a85fa4b8e4953ba66ff
Component: engine
This commit is contained in:
Michael Crosby
2014-07-07 10:28:31 -07:00

View File

@@ -176,7 +176,7 @@ func InitDriver(job *engine.Job) engine.Status {
func setupIPTables(addr net.Addr, icc bool) error {
// Enable NAT
natArgs := []string{"POSTROUTING", "-t", "nat", "-s", addr.String(), "!", "-d", addr.String(), "-j", "MASQUERADE"}
natArgs := []string{"POSTROUTING", "-t", "nat", "-s", addr.String(), "!", "-o", bridgeIface, "-j", "MASQUERADE"}
if !iptables.Exists(natArgs...) {
if output, err := iptables.Raw(append([]string{"-I"}, natArgs...)...); err != nil {