mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-05 06:42:21 -04:00
(tinc) add mode option
This commit is contained in:
parent
7c9075f551
commit
9af4e92996
4 changed files with 19 additions and 1 deletions
|
|
@ -5,6 +5,13 @@
|
|||
<type>checkbox</type>
|
||||
<help>Enable this network</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>network.mode</id>
|
||||
<label>Mode</label>
|
||||
<type>dropdown</type>
|
||||
<advanced>true</advanced>
|
||||
<help>This option selects the way packets are routed to other daemons</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>network.name</id>
|
||||
<label>Network Name</label>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<model>
|
||||
<mount>//OPNsense/Tinc</mount>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
<description>
|
||||
OPNsense Tinc VPN
|
||||
</description>
|
||||
|
|
@ -62,6 +62,14 @@
|
|||
<SourceFile>/tmp/tinc_current_cipher_options.index</SourceFile>
|
||||
<default>aes-256-cbc</default>
|
||||
</cipher>
|
||||
<mode type="OptionField">
|
||||
<Required>Y</Required>
|
||||
<default>router</default>
|
||||
<OptionValues>
|
||||
<router>router</router>
|
||||
<switch>switch</switch>
|
||||
</OptionValues>
|
||||
</mode>
|
||||
<enabled type="BooleanField">
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class Network(NetwConfObject):
|
|||
self._payload['privkey'] = None
|
||||
self._payload['intaddress'] = None
|
||||
self._payload['debuglevel'] = 'd0'
|
||||
self._payload['mode'] = 'switch'
|
||||
self._hosts = list()
|
||||
|
||||
def get_id(self):
|
||||
|
|
@ -86,6 +87,7 @@ class Network(NetwConfObject):
|
|||
def config_text(self):
|
||||
result = list()
|
||||
result.append('AddressFamily=any')
|
||||
result.append('Mode=%(mode)s' % self._payload)
|
||||
result.append('Port=%(port)s' % self._payload)
|
||||
result.append('PingTimeout=%(pingtimeout)s' % self._payload)
|
||||
for host in self._hosts:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
{% if network.enabled|default('0') == '1' %}
|
||||
<network>
|
||||
<id>{{network.id}}</id>
|
||||
<mode>{{network.mode}}</mode>
|
||||
<hostname>{{network.hostname}}</hostname>
|
||||
<network>{{network.name}}</network>
|
||||
<intaddress>{{network.intaddress}}</intaddress>
|
||||
|
|
|
|||
Loading…
Reference in a new issue