Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhifan huang
slapos
Commits
c7fbae28
Commit
c7fbae28
authored
Sep 19, 2019
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kvm: use 'ip' command instead of 'ifconfig' which is deprecated
parent
8aaf82a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
software/kvm/buildout.hash.cfg
software/kvm/buildout.hash.cfg
+1
-1
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+8
-10
No files found.
software/kvm/buildout.hash.cfg
View file @
c7fbae28
...
@@ -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 =
c79448a49b1b3dc6e757b90f497c7be1
md5sum =
12a99227828e834d97ee0c68246c467c
[template-kvm-cluster]
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
filename = instance-kvm-cluster.cfg.jinja2.in
...
...
software/kvm/instance-kvm.cfg.jinja2
View file @
c7fbae28
...
@@ -498,16 +498,15 @@ ipv6-network-info =
...
@@ -498,16 +498,15 @@ ipv6-network-info =
recipe = plone.recipe.command
recipe = plone.recipe.command
filename = netconfig.sh
filename = netconfig.sh
path = ${directory:public}/${:filename}
path = ${directory:public}/${:filename}
ifconfig = ifconfig \$IFACE {{ slap_configuration.get('tap-ipv4-addr') }} netmask {{ slap_configuration.get('tap-ipv4-netmask') }}
ipv4-add-address = ip -4 address add {{ slap_configuration.get('tap-ipv4-addr') }}/{{ slap_configuration.get('tap-ipv4-netmask') }} dev \$IFACE
route-iface = route add {{ slap_configuration.get('tap-ipv4-gateway') }} dev \$IFACE
route-network = route add -net {{ slap_configuration.get('tap-ipv4-network') }} netmask {{ slap_configuration.get('tap-ipv4-netmask') }} gw {{ slap_configuration.get('tap-ipv4-gateway') }}
{% if nat_restrict == 'true' -%}
{% if nat_restrict == 'true' -%}
route-default = route add default gw
{{ slap_configuration.get('tap-ipv4-gateway') }} dev \$IFACE
ipv4-add-default-route = ip route add default via
{{ slap_configuration.get('tap-ipv4-gateway') }} dev \$IFACE
{% elif global_ipv4_prefix -%}
{% elif global_ipv4_prefix -%}
route-default
= ip route add {{ global_ipv4_prefix }} via {{ slap_configuration.get('tap-ipv4-gateway') }} dev \$IFACE src {{ slap_configuration.get('tap-ipv4-addr') }}
ipv4-add-default-route
= ip route add {{ global_ipv4_prefix }} via {{ slap_configuration.get('tap-ipv4-gateway') }} dev \$IFACE src {{ slap_configuration.get('tap-ipv4-addr') }}
{% else -%}
{% else -%}
route-default
=
ipv4-add-default-route
=
{% endif -%}
{% endif -%}
ipv4-set-link-up = ip link set dev \$IFACE up
command =
command =
cat > ${:path} << EOF
cat > ${:path} << EOF
#!/bin/sh
#!/bin/sh
...
@@ -515,10 +514,9 @@ command =
...
@@ -515,10 +514,9 @@ command =
#try to be compatible with OS with old names
#try to be compatible with OS with old names
ip a | grep eth0: && [ \$IFACE = ens3 ] && IFACE=eth0
ip a | grep eth0: && [ \$IFACE = ens3 ] && IFACE=eth0
ip a | grep eth1: && [ \$IFACE = ens4 ] && IFACE=eth1
ip a | grep eth1: && [ \$IFACE = ens4 ] && IFACE=eth1
${:ifconfig}
${:ipv4-add-address}
${:route-iface}
${:ipv4-add-default-route}
${:route-network}
${:ipv4-set-link-up}
${:route-default}
EOF
EOF
update-command = ${:command}
update-command = ${:command}
{% endif -%}
{% endif -%}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment