diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2015-04-13 11:17:33 +0200 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2015-04-15 14:28:54 +0200 |
commit | d09155b684b90d14ddcae6a69fb99ce8d34f5c35 (patch) | |
tree | 579ba227e8b70e2080d23453b10e4a23f42531b9 /etc/inc/vpn.inc | |
parent | 4847615c9dec128c2efa6562600e34e1d24dd25d (diff) | |
download | pfsense-d09155b684b90d14ddcae6a69fb99ce8d34f5c35.zip pfsense-d09155b684b90d14ddcae6a69fb99ce8d34f5c35.tar.gz |
Add support for EAP-RADIUS to IKEv2 Mobile Clients (Rel. 2.2)
Diffstat (limited to 'etc/inc/vpn.inc')
-rw-r--r-- | etc/inc/vpn.inc | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index ccfbd12..100fa79 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -373,6 +373,28 @@ EOD; $strongswan .= "\tplugins {\n"; + $a_servers = auth_get_authserver_list(); + foreach ($a_servers as $id => $pconfig) { + if ($id == $config['ipsec']['client']['user_source'] && $pconfig['type'] == "radius") { + $strongswan .= <<<EOD + eap-radius { + class_group = yes + eap_start = no + servers { + primary { + address = {$pconfig['host']} + secret = {$pconfig['radius_secret']} + auth_port = {$pconfig['radius_auth_port']} + acct_port = {$pconfig['radius_acct_port']} + } + } + } + +EOD; + break; + } + } + if (is_array($a_client) && isset($a_client['enable'])) { $strongswan .= "\t\tattr {\n"; if ($a_client['pool_address'] && $a_client['pool_netbits']) @@ -499,7 +521,7 @@ EOD; continue; if (strstr($ph1ent['authentication_method'], 'rsa') || - in_array($ph1ent['authentication_method'], array('eap-mschapv2', 'eap-tls'))) { + in_array($ph1ent['authentication_method'], array('eap-mschapv2', 'eap-tls', 'eap-radius'))) { $certline = ''; $ikeid = $ph1ent['ikeid']; @@ -777,6 +799,18 @@ EOD; $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; } break; + case 'eap-radius': + if (isset($ph1ent['mobile'])) { + $authentication = "eap_identity=%identity\n\t"; + $authentication .= "leftauth=pubkey\n\trightauth=eap-radius"; + if (!empty($ph1ent['certref'])) + $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; + } else { + $authentication = "leftauth=eap-radius\n\trightauth=eap-radius"; + if (!empty($ph1ent['certref'])) + $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; + } + break; case 'xauth_rsa_server': $authentication = "leftauth = pubkey\n\trightauth = pubkey"; $authentication .= "\n\trightauth2 = xauth-generic"; |