5 lines
549 B
Django/Jinja
5 lines
549 B
Django/Jinja
{% macro ip_route(route, ifname) %}
|
|
{% if route.type|d %}{{ route.type }} {% endif %}{{ route.prefix }}{% if route.metric is defined %} metric {{ route.metric }}{% endif %}{% if route.source|d %} src {{ route.source }}{% endif %}{% if route.nexthop|d %}{% for hop in route.nexthop %} {% if loop.length > 1 %}nexthop {% endif %}via {{ hop.address }} dev {{ ifname }}{% if loop.length > 1 and hop.weight is defined %} weight {{ hop.weight }}{% endif %}{% endfor %}{% else %} dev {{ ifname }}{% endif %}
|
|
{% endmacro %}
|
|
{% block routes %}{% endblock %}
|