up
This commit is contained in:
parent
f9e4d0d900
commit
8f7e5fb2b9
1 changed files with 7 additions and 2 deletions
|
@ -25,14 +25,19 @@ class NodeClient():
|
|||
|
||||
def __container_config_create(container_id, link, ipv4, ipv6):
|
||||
cfg = []
|
||||
cfg.append("lxc.network.type = veth")
|
||||
cfg.append("lxc.network.flags = up")
|
||||
cfg.append("lxc.network.name = eth0")
|
||||
cfg.append("lxc.network.link = %s" % link)
|
||||
|
||||
if ipv4['ipv4']:
|
||||
cfg.append('lxc.network.ipv4 = %s/32' % ipv4['ipv4'])
|
||||
# cfg.append('lxc.network.ipv4 = %s/32' % ipv4['ipv4'])
|
||||
cfg.append('lxc.network.ipv4 = %s' % ipv4['ipv4'])
|
||||
cfg.append('lxc.network.ipv4.gateway = %s' % ipv4['ipv4_gateway'])
|
||||
|
||||
if 'ipv6' in ipv6 and 'ipv6_gateway' in ipv6:
|
||||
cfg.append('lxc.network.ipv6 = %s/64' % ipv6['ipv6'])
|
||||
# cfg.append('lxc.network.ipv6 = %s/64' % ipv6['ipv6'])
|
||||
cfg.append('lxc.network.ipv6 = %s' % ipv6['ipv6'])
|
||||
cfg.append('lxc.network.ipv6.gateway = %s', ipv6['ipv6_gateway'])
|
||||
|
||||
config_file = '/var/lib/gocloud/node/configs/%s.config' % container_id
|
||||
|
|
Loading…
Add table
Reference in a new issue