Project

General

Profile

« Previous | Next » 

Revision c1f5a46b

Added by Scott Ullrich over 19 years ago

MFC vpn ping code

View differences:

etc/crontab
7 7
1	*	1	*	*	root	        /usr/bin/nice -n20 /etc/rc.update_bogons.sh
8 8
*/60	*	*	*	*	root	        /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 sshlockout
9 9
1	1	*	*	*	root		/usr/bin/nice -n20 /etc/rc.dyndns.update
10
*/5	*	*	*	*	root		/usr/bin/nice -n20 /etc/ping_hosts.sh
etc/inc/vpn.inc
88 88
function vpn_ipsec_configure($ipchg = false) {
89 89
	global $config, $g, $sa, $sn;
90 90

  
91
	/* get the automatic /etc/ping_hosts.sh ready */
92
	unlink_if_exists("/var/db/ipsecpinghosts");
93
	touch("/var/db/ipsecpinghosts");
94

  
91 95
	if($g['booting'] == true) {
92 96
		/* determine if we should load the via padlock module */
93 97
		$dmesg_boot = `cat /var/log/dmesg.boot | grep CPU`;
......
192 196
							$tunnel['remote-gateway'] = $tmp;
193 197
					}
194 198

  
199
					/* add entry to host pinger */
200
					if($tunnel['pinghost']) {
201
						$pfd = fopen("/var/db/ipsecpinghosts","a");
202
						$srcip = find_interface_ip($config['interfaces']['lan']['if']);
203
						$dstip = $tunnel['pinghost'];
204
						fwrite($pfd, "$srcip|$dstip|3");
205
						fclose($pfd);
206
					}
207

  
195 208
					if(isset($tunnel['creategif'])) {
196 209
						$number_of_gifs = find_last_gif_device();
197 210
						$number_of_gifs++;
usr/local/www/vpn_ipsec_edit.php
90 90
	$pconfig['p2pfsgroup'] = $a_ipsec[$id]['p2']['pfsgroup'];
91 91
	$pconfig['p2lifetime'] = $a_ipsec[$id]['p2']['lifetime'];
92 92
	$pconfig['descr'] = $a_ipsec[$id]['descr'];
93
	$pconfig['pinghost'] = $a_ipsec[$id]['pinghost'];
93 94
	
94 95
} else {
95 96
	/* defaults */
......
226 227
		$ipsecent['p2']['pfsgroup'] = $_POST['p2pfsgroup'];
227 228
		$ipsecent['p2']['lifetime'] = $_POST['p2lifetime'];
228 229
		$ipsecent['descr'] = $_POST['descr'];
230
		$ipsecent['pinghost'] = $_POST['pinghost'];
229 231
		
230 232
		if (isset($id) && $a_ipsec[$id])
231 233
			$a_ipsec[$id] = $ipsecent;
......
550 552
                    <input name="p2lifetime" type="text" class="formfld" id="p2lifetime" size="20" value="<?=$pconfig['p2lifetime'];?>">
551 553
                    seconds</td>
552 554
                </tr>
555
                <tr> 
556
                  <td colspan="2" class="list" height="12"></td>
557
                </tr>
558
                <tr> 
559
                  <td colspan="2" valign="top" class="listtopic">Keep alive</td>
560
                </tr>
561
                <tr> 
562
                  <td width="22%" valign="top" class="vncell">Automatically ping host</td>
563
                  <td width="78%" class="vtable"> 
564
                    <input name="pinghost" type="text" class="formfld" id="pinghost" size="20" value="<?=$pconfig['pinghost'];?>"></td>
565
                </tr>		
553 566
                <tr> 
554 567
                  <td width="22%" valign="top">&nbsp;</td>
555 568
                  <td width="78%"> 

Also available in: Unified diff