Project

General

Profile

« Previous | Next » 

Revision e4342843

Added by Martin Fuchs over 17 years ago

OpenVPN: added keepalive and infinite resolver options

View differences:

etc/inc/openvpn.inc
393 393

  
394 394
    if (!empty($settings['tls'])) $openvpn_conf .= "tls-auth {$g['varetc_path']}/openvpn_server{$id}.tls 0\n";
395 395
		if (!empty($settings['maxclients'])) $openvpn_conf .= "max-clients {$settings['maxclients']}\n";
396
		if (!empty($settings['gwredir'])) $openvpn_conf .= "push \"redirect-gateway def1\"\n";
396
		if ($settings['gwredir']) $openvpn_conf .= "push \"redirect-gateway def1\"\n";
397
		if ($settings['keepalive']) $openvpn_conf .= "keepalive 12 120\n";
397 398
			}
398 399

  
399 400
	else { // $mode == client
......
465 466

  
466 467
	if ($settings['passtos']) $openvpn_conf .= "passtos\n";
467 468
	
469
	if ($settings['infiniteresolvretry']) $openvpn_conf .= "resolv-retry infinite\n";
470
	
468 471
	if ($settings['dynamic_ip']) {
469 472
		$openvpn_conf .= "persist-remote-ip\n";
470 473
		$openvpn_conf .= "float\n";
......
552 555
    if (!empty($settings['dhcp_nbtscope'])) $conf .= "push \"dhcp-option NBS {$settings['dhcp_nbtscope']}\"\n";
553 556
   	if ($settings['dhcp_nbtdisable']) $conf .= "push \"dhcp-option DISABLE-NBT\"\n";
554 557
    if ($settings['gwredir']) $conf .= "push \"redirect-gateway def1\"\n";
558
    if ($settings['keepalive']) $conf .= "keepalive 12 120\n";
555 559

  
556 560
	if (!empty($settings['custom_options'])) {
557 561
		$options = explode(';', $settings['custom_options']);
usr/local/pkg/openvpn.xml
259 259
			<type>checkbox</type>
260 260
		</field>
261 261
		<field>
262
			<fieldname>keepalive</fieldname>
263
			<fielddescr>Keep alive</fielddescr>
264
			<description>Sends bidirectional ICMP-like packets every 10 sec. to ensure hosts are up. Hosts are assumed to be down if no answer was received for 120 sec.</description>
265
			<type>checkbox</type>
266
		</field>		
267
    <field>
262 268
			<fieldname>custom_options</fieldname>
263 269
			<fielddescr>Custom options</fielddescr>
264 270
			<description>You can put your own custom options here, separated by semi-colons (;). They'll be added to the server configuration.</description>
usr/local/pkg/openvpn_cli.xml
205 205
			<description>Checking this will set the TOS field of the tunnel packet to what the payload's TOS is.</description>
206 206
			<type>checkbox</type>
207 207
		</field>
208
		<field>
209
			<fieldname>infiniteresolvretry</fieldname>
210
			<fielddescr>Infinitely resolve server</fielddescr>
211
			<description>Infinitely retry to resolve the host name of the OpenVPN server. Useful for not permanently internet-connected machines.</description>
212
			<type>checkbox</type>
213
		</field>
208 214
		<field>
209 215
			<fieldname>custom_options</fieldname>
210 216
			<fielddescr>Custom options</fielddescr>
usr/local/pkg/openvpn_csc.xml
149 149
			<description>Redirect ALL traffic through the OpenVPN server.</description>
150 150
			<type>checkbox</type>
151 151
		</field>
152
		<field>
153
			<fieldname>keepalive</fieldname>
154
			<fielddescr>Keep alive</fielddescr>
155
			<description>Sends bidirectional ICMP-like packets every 10 sec. to ensure hosts are up. Hosts are assumed to be down if no answer was received for 120 sec.</description>
156
			<type>checkbox</type>
157
		</field>
152 158
		<field>
153 159
			<fieldname>custom_options</fieldname>
154 160
			<fielddescr>Custom options</fielddescr>

Also available in: Unified diff