mirror of https://github.com/docker/docs.git
Make LXC aware of custom bridge
This commit is contained in:
parent
90a6e310fe
commit
d9a9bfc9c7
|
@ -135,6 +135,7 @@ type NetworkSettings struct {
|
||||||
IpAddress string
|
IpAddress string
|
||||||
IpPrefixLen int
|
IpPrefixLen int
|
||||||
Gateway string
|
Gateway string
|
||||||
|
Bridge string
|
||||||
PortMapping map[string]string
|
PortMapping map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,6 +492,7 @@ func (container *Container) allocateNetwork() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
container.network = iface
|
container.network = iface
|
||||||
|
container.NetworkSettings.Bridge = container.runtime.networkManager.bridgeIface
|
||||||
container.NetworkSettings.IpAddress = iface.IPNet.IP.String()
|
container.NetworkSettings.IpAddress = iface.IPNet.IP.String()
|
||||||
container.NetworkSettings.IpPrefixLen, _ = iface.IPNet.Mask.Size()
|
container.NetworkSettings.IpPrefixLen, _ = iface.IPNet.Mask.Size()
|
||||||
container.NetworkSettings.Gateway = iface.Gateway.String()
|
container.NetworkSettings.Gateway = iface.Gateway.String()
|
||||||
|
|
|
@ -16,7 +16,7 @@ lxc.utsname = {{.Id}}
|
||||||
# network configuration
|
# network configuration
|
||||||
lxc.network.type = veth
|
lxc.network.type = veth
|
||||||
lxc.network.flags = up
|
lxc.network.flags = up
|
||||||
lxc.network.link = lxcbr0
|
lxc.network.link = {{.NetworkSettings.Bridge}}
|
||||||
lxc.network.name = eth0
|
lxc.network.name = eth0
|
||||||
lxc.network.mtu = 1500
|
lxc.network.mtu = 1500
|
||||||
lxc.network.ipv4 = {{.NetworkSettings.IpAddress}}/{{.NetworkSettings.IpPrefixLen}}
|
lxc.network.ipv4 = {{.NetworkSettings.IpAddress}}/{{.NetworkSettings.IpPrefixLen}}
|
||||||
|
|
Loading…
Reference in New Issue