4 'require tools.widgets as widgets';
10 m = new form.Map('ipsec', _('strongSwan Configuration'),
11 _('Configure strongSwan for secure VPN connections.'));
13 // strongSwan General Settings
14 s = m.section(form.TypedSection, 'ipsec',
15 _('strongSwan General Settings'));
18 o = s.option(widgets.ZoneSelect, 'zone', _('Zone'),
19 _('Firewall zone that has to match the defined firewall zone'));
23 o = s.option(widgets.NetworkSelect, 'listen', _('Listen Interfaces'),
24 _('Interfaces that accept VPN traffic'));
25 o.datatype = 'interface';
26 o.placeholder = _('Select an interface or leave empty for all interfaces');
30 o = s.option(form.Value, 'debug', _('Debug Level'),
31 _('Logs written to /var/log/charon.log'));
33 o.datatype = 'uinteger';
35 // Remote Configuration
36 s = m.section(form.TypedSection, 'remote', _('Remote Configuration'));
39 o = s.option(form.Flag, 'enabled', _('Enabled'),
40 _('Configuration is enabled or not'));
42 o = s.option(form.Value, 'gateway', _('Gateway (Remote Endpoint)'),
43 _('Public IP address or FQDN name of the tunnel remote endpoint'));
44 o.datatype = 'or(hostname,ipaddr)';
46 o = s.option(form.Value, 'local_gateway', _('Local Gateway'),
47 _('IP address or FQDN of the tunnel local endpoint'));
48 o.datatype = 'or(hostname,ipaddr)';
50 o = s.option(form.Value, 'local_sourceip', _('Local Source IP'),
51 _('Virtual IP(s) to request in IKEv2 configuration payloads requests'));
52 o.datatype = 'ipaddr';
54 o = s.option(form.Value, 'local_ip', _('Local IP'),
55 _('Local address(es) to use in IKE negotiation'));
56 o.datatype = 'ipaddr';
58 o = s.option(form.Value, 'local_identifier', _('Local Identifier'),
59 _('Local identifier for IKE (phase 1)'));
60 o.datatype = 'string';
61 o.placeholder = 'C=US, O=Acme Corporation, CN=headquarters';
63 o = s.option(form.Value, 'remote_identifier', _('Remote Identifier'),
64 _('Remote identifier for IKE (phase 1)'));
65 o.datatype = 'string';
66 o.placeholder = 'C=US, O=Acme Corporation, CN=soho';
68 o = s.option(form.ListValue, 'authentication_method',
69 _('Authentication Method'), _('IKE authentication (phase 1).'));
70 o.value('psk', 'Pre-shared Key');
71 o.value('pubkey', 'Public Key');
74 o = s.option(form.Value, 'pre_shared_key', _('Pre-Shared Key'),
75 _('The pre-shared key for the tunnel if authentication is psk'));
76 o.datatype = 'string';
78 o.depends('authentication_method', 'psk');
80 o = s.option(form.Flag, 'mobike', _('MOBIKE'),
81 _('MOBIKE (IKEv2 Mobility and Multihoming Protocol)'));
84 o = s.option(form.ListValue, 'fragmentation', _('IKE Fragmentation'),
85 _('Use IKE fragmentation (yes, no, force, accept)'));
92 o = s.option(form.ListValue, 'crypto_proposal', _('Crypto Proposal'),
93 _('List of IKE (phase 1) proposals to use for authentication'));
94 o.value('encryption_algorithm');
95 o.value('hash_algorithm');
97 o.value('prf_algorithm');
99 o = s.option(form.Value, 'tunnel', _('Tunnel'),
100 _('Name of ESP/AH (phase 2) section'));
103 o = s.option(form.Value, 'authentication_method',
104 _('Authentication Method'), _('IKE authentication (phase 1)'));
105 o.datatype = 'string';
107 s = m.section(form.TypedSection, 'ipsec',
108 _('strongSwan General Settings'));
111 o = s.option(form.ListValue, 'encryption_algorithm',
112 _('Encryption Algorithm'), _('Encryption method (aes128, aes192, aes256, 3des)'));
119 o = s.option(form.ListValue, 'hash_algorithm', _('Hash Algorithm'),
120 _('Hash algorithm (md5, sha1, sha2, ...)'));
130 o.value('blake2s256');
131 o.value('blake2b512');
132 o.value('blake2s256');
133 o.value('blake2b512');
134 o.value('whirlpool');
138 o = s.option(form.ListValue, 'dh_group', _('Diffie-Hellman Group'),
139 _('Diffie-Hellman exponentiation (modp768, modp1024, ...)'));
148 o = s.option(form.ListValue, 'prf_algorithm', _('PRF Algorithm'),
149 _('Pseudo-Random Functions to use with IKE'));
150 o.value('prf_hmac_md5');
153 o.value('prfsha256');
155 o.value('prfsha512');
157 // Tunnel Configuration
158 s = m.section(form.TypedSection, 'tunnel', _('Tunnel Configuration'));
161 o = s.option(form.Value, 'local_subnet', _('Local Subnet'),
162 _('Local network(s)'));
163 o.placeholder = '192.168.1.1/24';
166 o = s.option(form.Value, 'remote_subnet', _('Remote Subnet'),
167 _('Remote network(s)'));
168 o.placeholder = '192.168.2.1/24';
171 o = s.option(form.Value, 'local_nat', _('Local NAT'),
172 _('NAT range for tunnels with overlapping IP addresses'));
173 o.datatype = 'subnet';
175 o = s.option(form.ListValue, 'crypto_proposal',
176 _('Crypto Proposal (Phase 2)'), _('List of ESP (phase two) proposals'));
177 o.value('encryption_algorithm');
178 o.value('hash_algorithm');
180 o.value('prf_algorithm');
183 o = s.option(form.ListValue, 'startaction', _('Start Action'),
184 _('Action on initial configuration load'));
190 o = s.option(form.Value, 'updown', _('Up/Down Script Path'),
191 _('Path to script to run on CHILD_SA up/down events'));
192 o.datatype = 'filepath';