Commit 0aec40f7 authored by Ad Schellevis's avatar Ad Schellevis

(ids/ips) use macro physical_interface

parent 285c4c62
{# Macro import #}
{% from 'OPNsense/Macros/interface.macro' import physical_interface %}
{% if helpers.exists('OPNsense.IDS.general') and OPNsense.IDS.general.enabled|default("0") == "1" %} {% if helpers.exists('OPNsense.IDS.general') and OPNsense.IDS.general.enabled|default("0") == "1" %}
suricata_enable="YES" suricata_enable="YES"
...@@ -12,10 +14,10 @@ suricata_netmap=YES ...@@ -12,10 +14,10 @@ suricata_netmap=YES
{% for intfName in OPNsense.IDS.general.interfaces.split(',') %} {% for intfName in OPNsense.IDS.general.interfaces.split(',') %}
{% if loop.index == 1 %} {% if loop.index == 1 %}
{# enable first interface #} {# enable first interface #}
suricata_interface="{{helpers.getNodeByTag('interfaces.'+intfName).if}}" suricata_interface="{{ physical_interface(intfName) }}"
{% else %} {% else %}
{# store additional interfaces to addFlags #} {# store additional interfaces to addFlags #}
{% do addFlags.append(helpers.getNodeByTag('interfaces.'+intfName).if) %} {% do addFlags.append(physical_interface(intfName)) %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{# append additional interfaces #} {# append additional interfaces #}
......
{# Macro import #}
{% from 'OPNsense/Macros/interface.macro' import physical_interface %}
%YAML 1.1 %YAML 1.1
--- ---
...@@ -317,11 +319,11 @@ netmap: ...@@ -317,11 +319,11 @@ netmap:
{% if helpers.exists('OPNsense.IDS.general.interfaces') %} {% if helpers.exists('OPNsense.IDS.general.interfaces') %}
{% for intfName in OPNsense.IDS.general.interfaces.split(',') %} {% for intfName in OPNsense.IDS.general.interfaces.split(',') %}
- interface: {{helpers.getNodeByTag('interfaces.'+intfName).if}} - interface: {{physical_interface(intfName)}}
copy-iface: {{helpers.getNodeByTag('interfaces.'+intfName).if}}+ copy-iface: {{physical_interface(intfName)}}+
- interface: {{helpers.getNodeByTag('interfaces.'+intfName).if}}+ - interface: {{physical_interface(intfName)}}+
copy-iface: {{helpers.getNodeByTag('interfaces.'+intfName).if}} copy-iface: {{physical_interface(intfName)}}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment