-
Notifications
You must be signed in to change notification settings - Fork 759
/
filter_tables.conf
54 lines (54 loc) · 2.01 KB
/
filter_tables.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<tabledef>
<general>
{% if not system.checkaliasesurlcert %}
<ssl_no_verify>1</ssl_no_verify>
{% endif %}
</general>
{% set new_style_aliases = 0 %}
{% if helpers.exists('OPNsense.Firewall.Alias.aliases.alias') %}
{% set new_style_aliases = OPNsense.Firewall.Alias.aliases.alias|length %}
{% for alias in helpers.toList('OPNsense.Firewall.Alias.aliases.alias') %}
{% if alias.type.find('port') == -1 %}
<table>
<name>{{ alias.name|e }}</name>
<descr>{{ alias.description|default('')|e}}</descr>
<type>{{ alias.type }}</type>
{% if alias.enabled|default('0') == '0'%}
<address></address>
{% elif alias.type.startswith('urltable') %}
<url>{{ alias.content|e|encode_idna }}</url>
{% elif alias.type.startswith('url') %}
<aliasurl>{{ alias.content|e|encode_idna }}</aliasurl>
{% elif alias.content %}
<address>{{ alias.content|e|encode_idna }}</address>
{% endif %}{% if alias.interface and alias.type == 'dynipv6host' %}
<interface>{{ helpers.physical_interface(alias.interface)|default('LAN')}}</interface>
{% endif %}{% if alias.proto %}
<proto>{{ alias.proto|e }}</proto>
{% endif %}{% if alias.updatefreq %}
<ttl>{{ alias.updatefreq|float * 86400 }}</ttl>
{% elif alias.type in ['geoip', 'asn'] %}
<ttl>86400</ttl>
{% elif alias.type == 'host' %}
<ttl>{{ system.aliasesresolveinterval|default('300') }}</ttl>
{% elif alias.type == 'mac' %}
<ttl>30</ttl>
{% elif alias.type in ['dynipv6host', 'authgroup'] %}
<ttl>1</ttl>
{% endif %}
</table>
{% endif %}
{% endfor %}
{% endif %}
{% if not helpers.empty('interfaces') %}
{% for intf_key,intf_item in interfaces.items() %}
<table>
<name>__{{intf_key}}_network</name>
<descr>{% if intf_item.descr %}{{ intf_item.descr|e }}{% else %}{{intf_key}} net{% endif %}</descr>
<type>interface_net</type>
<ttl>1</ttl>
<interface>{{intf_item.if}}</interface>
</table>
{% endfor %}
{% endif %}
</tabledef>