Timotej Lazar
d123db4e64
I have tried every possible permutation and I think this is the one. NetBox-managed IP prefixes are pushed with ansible to firewall master. The managed prefixes are added to custom IP sets defined in the app, but only NAT addresses and VPN groups can be configured for them. This way all NAT and VPN policy is (again) configured in the app. Also both NetBox-managed and user-defined networks are treated the same. Also improve^Wtweak config generation. Also templates.
57 lines
1.5 KiB
HTML
57 lines
1.5 KiB
HTML
{% extends 'base.html' %}
|
|
{% block header %}
|
|
<style>
|
|
tbody > tr:nth-child(odd) {
|
|
background-color: #eeeeee;
|
|
}
|
|
td {
|
|
vertical-align: top;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<p>
|
|
Urejate pravilo #{{ index }}. <a href="{{ url_for('rules.index') }}">Seznam pravil.</a>
|
|
|
|
<form id="request" method="POST">
|
|
<p>
|
|
<label for="name">Ime</label><br>
|
|
<input name="name" value="{{ rule.name }}" />
|
|
|
|
<p>
|
|
Uporabniki, ki lahko o(ne)mogočijo pravilo<br>
|
|
{% for manager in rule.managers %}
|
|
<input name="manager" type="text" style="width: 50%" value="{{ manager }}" /><br>
|
|
{% endfor %}
|
|
<input name="manager" type="text" style="width: 50%" value="" />
|
|
|
|
<p>
|
|
<label for="text">Pravila nftables</label>
|
|
<textarea id="text" name="text" style="width: 100%; height: 20em;" placeholder="iif @inside ip saddr @from ip daddr @to accept
|
|
iif @inside ip6 saddr @from/6 ip6 daddr @to/6 accept">
|
|
{{- rule.text }}
|
|
</textarea>
|
|
<p><button id="submit" type="submit">Shrani</button>
|
|
</form>
|
|
|
|
<p>
|
|
V pravilih lahko uporabljamo spodnja območja IP, npr. <code>@pr5</code> in <code>@pr5/6</code> za območji IPv4 in IPv6 učilnice 5. Za notranja omrežja uporabimo vmesnik <code>@inside</code>, za zunanja pa vmesnik <code>@outside</code>. Primere z razlago najdemo v <a href="https://wiki.nftables.org">dokumentaciji nftables</a>.
|
|
|
|
<table style="width: 100%;">
|
|
<thead>
|
|
<th>Omrežje
|
|
<th>IP
|
|
<th>IPv6
|
|
<th>VPN
|
|
<tbody>
|
|
{% for name, data in ipsets.items() %}
|
|
<tr>
|
|
<td>{{ name }}
|
|
<td>{{ data.ip|join('<br>')|safe }}
|
|
<td>{{ data.ip6|join('<br>')|safe }}
|
|
<td>{{ data.vpn }}
|
|
{% endfor %}
|
|
</table>
|
|
|
|
{% endblock %}
|