Commit a11bc963 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

[KVM] better information for IPv6

parent a9e6aefa
...@@ -19,7 +19,7 @@ md5sum = 028b6a6456d744c11b1bb2c51ecd51b2 ...@@ -19,7 +19,7 @@ md5sum = 028b6a6456d744c11b1bb2c51ecd51b2
[template-kvm] [template-kvm]
filename = instance-kvm.cfg.jinja2 filename = instance-kvm.cfg.jinja2
md5sum = e30912b1256bb093329ee3c108666f05 md5sum = 8caf061c0e769b172ebb8ec5cb3364b8
[template-kvm-cluster] [template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in filename = instance-kvm-cluster.cfg.jinja2.in
...@@ -27,7 +27,7 @@ md5sum = 63fa784d8946d0b6e3fbd6381e1ea9f4 ...@@ -27,7 +27,7 @@ md5sum = 63fa784d8946d0b6e3fbd6381e1ea9f4
[template-kvm-resilient] [template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2 filename = instance-kvm-resilient.cfg.jinja2
md5sum = c189bce8b196a3b5bcb01526a3f9b2aa md5sum = dbf88a6630e419af42cd35944407b940
[template-kvm-import] [template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in filename = instance-kvm-import.cfg.jinja2.in
......
...@@ -67,13 +67,14 @@ return = ...@@ -67,13 +67,14 @@ return =
url ssh-public-key ssh-url notification-id ip {{ monitor_return | join(' ') }} url ssh-public-key ssh-url notification-id ip {{ monitor_return | join(' ') }}
# KVM related parameters # KVM related parameters
# XXX: return ALL parameters (like nat rules), through jinja # XXX: return ALL parameters (like nat rules), through jinja
backend-url url ip backend-url url ip ipv6-network-info
[publish-connection-information] [publish-connection-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
backend-url = ${request-kvm:connection-backend-url} backend-url = ${request-kvm:connection-backend-url}
url = ${request-kvm:connection-url} url = ${request-kvm:connection-url}
ipv6 = ${request-kvm:connection-ip} ipv6 = ${request-kvm:connection-ip}
ipv6-network-info = ${request-kvm:connection-ipv6-network-info}
monitor-password = ${publish-early:monitor-password} monitor-password = ${publish-early:monitor-password}
monitor-user = ${monitor-publish-parameters:monitor-user} monitor-user = ${monitor-publish-parameters:monitor-user}
{% if monitor_dict -%} {% if monitor_dict -%}
......
...@@ -466,12 +466,12 @@ key_info = Get the publick key file in your VM with the command: wget {{ kvm_htt ...@@ -466,12 +466,12 @@ key_info = Get the publick key file in your VM with the command: wget {{ kvm_htt
{% if use_tap == 'true' and slap_configuration.get('tap-ipv4-addr', '') != "" -%} {% if use_tap == 'true' and slap_configuration.get('tap-ipv4-addr', '') != "" -%}
ipv4-network-info = ipv4-network-info =
Use these configurations below to configure IPv4 on interface {{ iface }} in your VM. Use this configuration in /etc/network/interfaces to configure IPv6 on interface {{ iface }} in your VM.
IFACE={{ iface }} auto {{ iface }}
${network-config-ipv4:ifconfig} iface {{ iface }} inet6 static
${network-config-ipv4:route-iface} address {{ slap_configuration.get('tap-ipv6-addr') }}
${network-config-ipv4:route-network} netmask {{ slap_configuration.get('tap-ipv6-netmask') }}
${network-config-ipv4:route-default} gateway {{ slap_configuration.get('tap-ipv6-gateway') }}
{% if enable_http == 'true' %} {% if enable_http == 'true' %}
${helper:blank-line} ${helper:blank-line}
Or run in your VM the command: wget -O- {{ kvm_http }}/netconfig.sh | /bin/sh - Or run in your VM the command: wget -O- {{ kvm_http }}/netconfig.sh | /bin/sh -
...@@ -480,14 +480,15 @@ ipv4-network-info = ...@@ -480,14 +480,15 @@ ipv4-network-info =
ipv6-network-info = ipv6-network-info =
{% if use_tap == 'true' and slap_configuration.get('tap-ipv6-addr', '') != "" %} {% if use_tap == 'true' and slap_configuration.get('tap-ipv6-addr', '') != "" %}
Use these configurations below to configure IPv6 on interface {{ iface }} in your VM. Use this configuration in /etc/network/interfaces to configure IPv6 on interface {{ iface }} in your VM.
IFACE={{ iface }} auto {{ iface }}
ip link set dev $IFACE up iface {{ iface }} inet6 static
${network-config-ipv6:ipv6-add-address} address {{ slap_configuration.get('tap-ipv6-gateway') }}
${network-config-ipv6:ipv6-add-default-route} netmask {{ slap_configuration.get('tap-ipv6-network').split('/')[1] }}
gateway {{ slap_configuration.get('tap-ipv6-addr') }}
{% if enable_http == 'true' %} {% if enable_http == 'true' %}
${helper:blank-line} ${helper:blank-line}
Or run in your VM the command: wget -O- {{ kvm_http }}/ipv6_config.sh | /bin/sh - Or run in your VM the command: wget -O- {{ kvm_http }}/${network-config-ipv6:filename} | /bin/sh -
{% endif %} {% endif %}
{% endif %} {% endif %}
...@@ -524,16 +525,19 @@ update-command = ${:command} ...@@ -524,16 +525,19 @@ update-command = ${:command}
{% if use_tap == 'true' and slap_configuration.get('tap-ipv6-addr', '') != "" -%} {% if use_tap == 'true' and slap_configuration.get('tap-ipv6-addr', '') != "" -%}
[network-config-ipv6] [network-config-ipv6]
recipe = plone.recipe.command recipe = plone.recipe.command
path = ${directory:public}/ipv6_config.sh filename = ipv6_config.sh
ipv6-add-address = ip -6 address add {{ slap_configuration.get('tap-ipv6-network') }} dev \$IFACE path = ${directory:public}/${:filename}
ipv6-add-address = ip -6 address add {{ slap_configuration.get('tap-ipv6-gateway') }}/{{ slap_configuration.get('tap-ipv6-network').split('/')[1] }} dev \$IFACE
ipv6-add-default-route = ipv6-add-default-route =
ip -6 route del default ; ip -6 route add default dev \$IFACE via {{ slap_configuration.get('tap-ipv6-gateway') }} ip -6 route del default ; ip -6 route add default dev \$IFACE via {{ slap_configuration.get('tap-ipv6-addr') }}
ipv6-set-link-up = ip link set dev \$IFACE up
command = command =
cat > ${:path} << EOF cat > ${:path} << EOF
#!/bin/sh #!/bin/sh
IFACE={{ iface }} IFACE={{ iface }}
${:ipv6-add-address} ${:ipv6-add-address}
${:ipv6-add-default-route} ${:ipv6-add-default-route}
${:ipv6-set-link-up}
EOF EOF
update-command = ${:command} update-command = ${:command}
{% endif -%} {% endif -%}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment