if gateway is not specified use iface

This will allow for the route to be applied to drop the packets on that
interface.
This commit is contained in:
Daniel Wallace 2017-11-29 10:31:52 -07:00
parent 6169b52749
commit 439dc8dce6
No known key found for this signature in database
GPG Key ID: 5FA5E5544F010D48
2 changed files with 3 additions and 2 deletions

View File

@ -1070,8 +1070,8 @@ def build_routes(iface, **settings):
log.debug("IPv4 routes:\n{0}".format(opts4))
log.debug("IPv6 routes:\n{0}".format(opts6))
routecfg = template.render(routes=opts4)
routecfg6 = template.render(routes=opts6)
routecfg = template.render(routes=opts4, iface=iface)
routecfg6 = template.render(routes=opts6, iface=iface)
if settings['test']:
routes = _read_temp(routecfg)

View File

@ -5,5 +5,6 @@
/{{route.netmask}}
{%- endif -%}
{%- if route.gateway %} via {{route.gateway}}
{%- else %} dev {{iface}}
{%- endif %}
{% endfor -%}