Browse Source

Correct host only routes

The host only route was adding the cidr twice which is wrong. This
change adds the missing network filter to correct the issue.

Change-Id: Ic280db301ce44b98ac35c8911999dec5fa263a29
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
changes/35/608735/3
Kevin Carter 8 months ago
parent
commit
ca24797261
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      tasks/nspawn_networking.yml

+ 1
- 1
tasks/nspawn_networking.yml View File

@@ -106,7 +106,7 @@
106 106
           {%        elif (value.address is defined) and ((interface_data['ipv4'] | default({'address': none}))['address'] != value.address) and ((value.host_only | default(false)) | bool) %}
107 107
           {%          set net_cidr = (value.address ~ '/' ~ (value.netmask | default('32'))) %}
108 108
           {%          set _ = start_commands.append('-/sbin/ip address add ' ~ net_cidr ~ ' dev ' ~ mv_interface ~ ' scope host noprefixroute') %}
109
-          {%          set _ = start_commands.append('-/sbin/ip route add ' ~ net_cidr ~ '/' ~ (value.netmask | default('32')) ~ ' dev ' ~ mv_interface ~ ' metric 100 proto kernel scope link table local') %}
109
+          {%          set _ = start_commands.append('-/sbin/ip route add ' ~ (net_cidr | ipaddr('network')) ~ '/' ~ (value.netmask | default('32')) ~ ' dev ' ~ mv_interface ~ ' metric 100 proto kernel scope link table local') %}
110 110
           {%-       endif %}
111 111
           {%-     endif %}
112 112
           {%-   endif %}

Loading…
Cancel
Save