4 'require tools.widgets as widgets';
10 m = new form.Map('ipsec',
11 _('strongSwan Configuration'),
12 _("Configure strongSwan for secure VPN connections."));
14 // strongSwan General Settings
15 s = m.section(form.TypedSection, 'ipsec', _('strongSwan General Settings'));
18 o = s.option(widgets.ZoneSelect, 'zone', _('Zone'), _('Firewall zone that has to match the defined firewall zone'));
22 o = s.option(widgets.NetworkSelect, 'listen', _('Listen Interfaces'), _('Interfaces that accept VPN traffic'));
23 o.datatype = 'interface';
24 o.placeholder = _('Select an interface or leave empty for all interfaces');
28 o = s.option(form.Value, 'debug', _('Debug Level'), _('Logs written to /var/log/charon.log'));
30 o.datatype = "uinteger";
32 // Remote Configuration
33 s = m.section(form.TypedSection, 'remote', _('Remote Configuration'));
36 o = s.option(form.Flag, 'enabled', _('Enabled'), _('Configuration is enabled or not'));
38 o = s.option(form.Value, 'gateway', _('Gateway (Remote Endpoint)'), _('Public IP address or FQDN name of the tunnel remote endpoint'));
39 o.datatype = 'or(hostname,ipaddr)';
41 o = s.option(form.Value, 'local_gateway', _('Local Gateway'), _('IP address or FQDN of the tunnel local endpoint'));
42 o.datatype = 'or(hostname,ipaddr)';
44 o = s.option(form.Value, 'local_sourceip', _('Local Source IP'), _('Virtual IP(s) to request in IKEv2 configuration payloads requests'));
45 o.datatype = 'ipaddr';
47 o = s.option(form.Value, 'local_ip', _('Local IP'), _('Local address(es) to use in IKE negotiation'));
48 o.datatype = 'ipaddr';
50 o = s.option(form.Value, 'local_identifier', _('Local Identifier'), _('Local identifier for IKE (phase 1)'));
51 o.datatype = 'string';
52 o.placeholder = "C=US, O=Acme Corporation, CN=headquarters"
54 o = s.option(form.Value, 'remote_identifier', _('Remote Identifier'), _('Remote identifier for IKE (phase 1)'));
55 o.datatype = 'string';
56 o.placeholder = "C=US, O=Acme Corporation, CN=soho"
58 o = s.option(form.ListValue, 'authentication_method', _('Authentication Method'), _('IKE authentication (phase 1).'));
59 o.value('psk', "Pre-shared Key");
60 o.value('pubkey', "Public Key");
63 o = s.option(form.Value, 'pre_shared_key', _('Pre-Shared Key'), _('The pre-shared key for the tunnel if authentication is psk'));
64 o.datatype = 'string';
66 o.depends('authentication_method', 'psk');
68 o = s.option(form.Flag, 'mobike', _('MOBIKE'), _('MOBIKE (IKEv2 Mobility and Multihoming Protocol)'));
71 o = s.option(form.ListValue, 'fragmentation', _('IKE Fragmentation'), _('Use IKE fragmentation (yes, no, force, accept)'));
78 o = s.option(form.ListValue, 'crypto_proposal', _('Crypto Proposal'), _('List of IKE (phase 1) proposals to use for authentication'));
79 o.value('encryption_algorithm');
80 o.value('hash_algorithm');
82 o.value('prf_algorithm');
84 o = s.option(form.Value, 'tunnel', _('Tunnel'), _('Name of ESP/AH (phase 2) section'));
87 o = s.option(form.Value, 'authentication_method', _('Authentication Method'), _('IKE authentication (phase 1)'));
88 o.datatype = 'string';
90 s = m.section(form.TypedSection, 'ipsec', _('strongSwan General Settings'));
93 o = s.option(form.ListValue, 'encryption_algorithm', _('Encryption Algorithm'), _('Encryption method (aes128, aes192, aes256, 3des)'));
100 o = s.option(form.ListValue, 'hash_algorithm', _('Hash Algorithm'), _('Hash algorithm (md5, sha1, sha2, ...)'));
110 o.value('blake2s256');
111 o.value('blake2b512');
112 o.value('blake2s256');
113 o.value('blake2b512');
114 o.value('whirlpool');
118 o = s.option(form.ListValue, 'dh_group', _('Diffie-Hellman Group'), _('Diffie-Hellman exponentiation (modp768, modp1024, ...)'));
127 o = s.option(form.ListValue, 'prf_algorithm', _('PRF Algorithm'), _('Pseudo-Random Functions to use with IKE'));
128 o.value('prf_hmac_md5');
135 // Tunnel Configuration
136 s = m.section(form.TypedSection, 'tunnel', _('Tunnel Configuration'));
139 o = s.option(form.Value, 'local_subnet', _('Local Subnet'), _('Local network(s)'));
140 o.placeholder = "192.168.1.1/24"
143 o = s.option(form.Value, 'remote_subnet', _('Remote Subnet'), _('Remote network(s)'));
144 o.placeholder = "192.168.2.1/24"
147 o = s.option(form.Value, 'local_nat', _('Local NAT'), _('NAT range for tunnels with overlapping IP addresses'));
148 o.datatype = 'subnet';
150 o = s.option(form.ListValue, 'crypto_proposal', _('Crypto Proposal (Phase 2)'), _('List of ESP (phase two) proposals'));
151 o.value('encryption_algorithm');
152 o.value('hash_algorithm');
154 o.value('prf_algorithm');
157 o = s.option(form.ListValue, 'startaction', _('Start Action'), _('Action on initial configuration load'));
163 o = s.option(form.Value, 'updown', _('Up/Down Script Path'), _('Path to script to run on CHILD_SA up/down events'));
164 o.datatype = 'filepath';