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>
This commit is contained in:
Kevin Carter 2018-10-08 11:59:24 -05:00 committed by Mohammed Naser
parent 873ae46e82
commit ca24797261
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@
{% elif (value.address is defined) and ((interface_data['ipv4'] | default({'address': none}))['address'] != value.address) and ((value.host_only | default(false)) | bool) %}
{% set net_cidr = (value.address ~ '/' ~ (value.netmask | default('32'))) %}
{% set _ = start_commands.append('-/sbin/ip address add ' ~ net_cidr ~ ' dev ' ~ mv_interface ~ ' scope host noprefixroute') %}
{% 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') %}
{% 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') %}
{%- endif %}
{%- endif %}
{%- endif %}