diff options
author | jim-p <jimp@pfsense.org> | 2010-11-08 17:19:48 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-11-08 17:21:27 -0500 |
commit | 6e8b0ec31045316cae3ed8638b12279870cc7fda (patch) | |
tree | 8bb741f5f16ab2d9df9973a7469c44eab5e499c5 /usr/local | |
parent | 61ab4cd32723f037b9f99a59407f1a4bc1ad8d0b (diff) | |
download | pfsense-6e8b0ec31045316cae3ed8638b12279870cc7fda.zip pfsense-6e8b0ec31045316cae3ed8638b12279870cc7fda.tar.gz |
Add a button to connect a non-mobile IPsec VPN from Status > IPsec. Sends a ping from a local IP in the p2 subnet (if one exists on the router) to the remote p2 subnet.
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/diag_ipsec.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 9992f5c..e682a5f 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -51,6 +51,12 @@ require("guiconfig.inc"); include("head.inc"); require("ipsec.inc"); +if ($_GET['act'] == "connect") { + if (is_ipaddr($_GET['remoteid']) && is_ipaddr($_GET['source'])) { + exec("/sbin/ping -S " . escapeshellarg($_GET['source']) . " -c 1 " . escapeshellarg($_GET['remoteid'])); + } +} + if (!is_array($config['ipsec']['phase2'])) $config['ipsec']['phase2'] = array(); @@ -119,6 +125,26 @@ $sad = ipsec_dump_sad(); <img src ="/themes/<?=$g['theme']?>/images/icons/icon_<?=$icon?>.gif"> </center> </td> + <td class="list"> + <?php + $source = ""; + if ($ph2ent['localid']['type'] == 'lan') { + $source = get_interface_ip('lan'); + } else { + $source = get_interface_ip(find_ip_interface($ph2ent['localid']['address'])); + } + + ?> + <?php if (($ph2ent['remoteid']['type'] != "mobile") && ($icon != "pass") && ($source != "")): ?> + <center> + <a href="diag_ipsec.php?act=connect&remoteid=<?= $ph2ent['remoteid']['address'] ?>&source=<?= $source ?>"> + <img src ="/themes/<?=$g['theme']?>/images/icons/icon_service_start.gif" alt="Connect VPN" title="Connect VPN" border="0"> + </a> + </center> + <?php else: ?> + + <?php endif; ?> + </td> </tr> <?php } |