. Copyright (C) 2008 Shrew Soft Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ##|+PRIV ##|*IDENT=page-vpn-ipsec ##|*NAME=VPN: IPsec page ##|*DESCR=Allow access to the 'VPN: IPsec' page. ##|*MATCH=vpn_ipsec.php* ##|-PRIV require("guiconfig.inc"); if (!is_array($config['ipsec']['phase1'])) $config['ipsec']['phase1'] = array(); if (!is_array($config['ipsec']['phase2'])) $config['ipsec']['phase2'] = array(); $a_phase1 = &$config['ipsec']['phase1']; $a_phase2 = &$config['ipsec']['phase2']; $wancfg = &$config['interfaces']['wan']; $pconfig['enable'] = isset($config['ipsec']['enable']); if ($_POST) { if ($_POST['apply']) { $retval = 0; $retval = vpn_ipsec_refresh_policies(); $retval = vpn_ipsec_configure(); /* reload the filter in the background */ filter_configure(); $savemsg = get_std_save_message($retval); if ($retval == 0) { if (file_exists($d_ipsecconfdirty_path)) unlink($d_ipsecconfdirty_path); } } else if ($_POST['submit']) { $pconfig = $_POST; $config['ipsec']['enable'] = $_POST['enable'] ? true : false; write_config(); } } if ($_GET['act'] == "delph1") { if ($a_phase1[$_GET['p1index']]) { /* remove static route if interface is not WAN */ if ($a_phase1[$_GET['p1index']]['interface'] <> "wan") mwexec("/sbin/route delete -host {$$a_phase1[$_GET['p1index']]['remote-gateway']}"); /* remove all phase2 entries that match the ikeid */ $ikeid = $a_phase1[$_GET['p1index']]['ikeid']; foreach ($a_phase2 as $p2index => $ph2tmp) if ($ph2tmp['ikeid'] == $ikeid) unset($a_phase2[$p2index]); /* remove the phase1 entry */ unset($a_phase1[$_GET['p1index']]); vpn_ipsec_refresh_policies(); vpn_ipsec_configure(); filter_configure(); write_config(); header("Location: vpn_ipsec.php"); exit; } } if ($_GET['act'] == "delph2") { if ($a_phase2[$_GET['p2index']]) { /* remove the phase2 entry */ unset($a_phase2[$_GET['p2index']]); vpn_ipsec_refresh_policies(); vpn_ipsec_configure(); filter_configure(); write_config(); header("Location: vpn_ipsec.php"); exit; } } $pgtitle = array("VPN","IPsec"); include("head.inc"); ?>
You must apply the changes in order for them to take effect."); ?>
> Enable IPsec
"; $spane = ""; } else $spans = $spane = ""; show_ipsec_header($ph1ent); $counter++; // used to deterimine if we need to output header manually (no records exist) ?>
".$ph1ent['remote-gateway']; else echo $if."
Mobile Client"; ?>
 
- Show Phase-2 entries
"; $spane = ""; } else $spans = $spane = ""; ?>
 

Note:
You can check your IPsec status at Status:IPsec.

Remote Gateway Mode P1 Protocol P1 Transforms P1 Description EOF; } ?>