AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[eap](server)

Martin Hope
Lasse Michael Mølgaard
Asked: 2021-06-02 02:06:33 +0800 CST

当来自 Windows VPN 客户端时,半径身份验证在 Strongswan 中不起作用?

  • 0

我的 strongswan VPN 服务器正在针对本地 Freeradius 服务器对 VPN 客户端进行身份验证。

所有用户日志都被代理到远程 radius 服务器,该服务器根据 Samba Active Directory 服务器验证用户。

但是我遇到了一些问题。

以下部分适用于使用 Strongswan VPN 客户端的 Android 用户:

connections
{
  rw-eap {
    local_addrs = SERVER_PUBLIC_IPV4, SERVER_PUBLIC_IPV6

    local {
      auth = pubkey
      certs = example-ecdsa.cer
      id = vpn.example.com
    }
    remote-android {
      auth = eap-radius
      id = *@example.com
    }
  }
}

监视 Freeradius 的输出显示如下内容:

(5) Received Access-Request Id 135 from 192.168.200.1:47851 to 192.168.200.1:1812 length 193
(5)   User-Name = "[email protected]"
(5)   NAS-Port-Type = Virtual
(5)   Service-Type = Framed-User
(5)   NAS-Port = 4
(5)   NAS-Port-Id = "rw-eap"
(5)   NAS-IP-Address = SERVER_PUBLIC_IPV4
(5)   Called-Station-Id = "SERVER_PUBLIC_IPV4[4500]"
(5)   Calling-Station-Id = "CLIENT_IPV4[3988]"

来自 Strongswan 的日志给出:

06[IKE] IKE_SA rw-eap[6] established between SERVER_PUBLIC_IPV4[vpn.example.com]...CLIENT_IPV4[[email protected]]

但是,当尝试从 Windows 客户端连接到服务器时,除非我在 Strongswan 中使用以下配置,否则它几乎是死在水中:

connections
{
  rw-windows {
    local_addrs = SERVER_PUBLIC_IPV4, SERVER_PUBLIC_IPV6

    local {
      auth = pubkey
      certs = example-ecdsa.cer
      id = vpn.example.com
    }

    remote-windows {
      auth = eap-radius

      # Don't use *@example.com here - as windows does not pass username as id, 
      # so this config will not match in that case.
      id = %any
    }
  }
}

使用此配置,我至少可以让 Strongswan 启动 Radius 身份验证,但我没有比这更进一步。

Freeradius 的输出给了我类似的东西:

(21) Received Access-Request Id 151 from 192.168.200.1:47851 to 192.168.200.1:1812 length 306
(21)   User-Name = "\300\250\000d"
(21)   NAS-Port-Type = Virtual
(21)   Service-Type = Framed-User
(21)   NAS-Port = 7
(21)   NAS-Port-Id = "rw-windows"
(21)   NAS-IP-Address = SERVER_PUBLIC_IPV4
(21)   Called-Station-Id = "SERVER_PUBLIC_IPV4[4500]"
(21)   Calling-Station-Id = "CLIENT_PUBLIC_IPV4[3989]"

这导致 Strongswan 日志中出现以下条目:

06[CFG] looking for peer configs matching SERVER_PUBLIC_IPV4[%any]...CLIENT_PUBLIC_IPV4[CLIENT_PRIVATE_IPV4]

这导致了我的几个问题,例如:

  • 第一:为什么Windows VPN客户端不像Strongswan那样将用户名作为ID传递?

  • 第二:为什么将用户名从 Strongswan 传递给 Freeradius "\300\250\000d"?

在 Windows 客户端上进行更多调试:

上面的示例是在使用 MS-CHAP v2 的客户端上使用 EAP-TTLS 时生成的。

当使用 MS-CHAP 时,Freeradius 确实会使用正确的用户名调用,但是当请求被代理时,用户名/密码身份验证失败。

我想 MS-CHAP 登录需要封装或其他什么,因为身份验证请求的编码与 Android 用户连接时的编码不同?

strongswan freeradius2 eap
  • 1 个回答
  • 421 Views
Martin Hope
user397220
Asked: 2017-01-27 06:06:34 +0800 CST

使用 EAP-TLS 和 WiFi 802.1x 的 Freeradius VLAN 分配

  • 2

我正在使用 FreeRadius 和带有 802.1x 身份验证的 Ubitquiti WiFi AP,使用 EAP-TLS(基于互客户端/服务器证书的身份验证)。这适用于静态 VLAN(即在 AP 上指定)。

我想将 VLAN 分配卸载到 Radius,以便可以将不同的用户分配到不同的 VLAN。

我不确定如何使用 EAP-TLS 来做到这一点。我在网上找到的所有文档都使用用户文件,但使用的是其他 EAP 方法。

所以,我把它放在我的 /etc/freeradius/users 文件的顶部:

DEFAULT        Tunnel-Medium-Type = 6
               Tunnel-Private-Group-ID = [12],
               Tunnel-Type = VLAN

但是,Radius 没有分配 VLAN。

我不知道从这里去哪里。也许我需要 /etc/freeradius/eap.conf 的 tls 部分中的某些内容来告诉它使用用户文件?

感谢您的帮助,谢谢!

802.1 ssl radius freeradius eap
  • 1 个回答
  • 7296 Views
Martin Hope
HopelessN00b
Asked: 2012-07-17 09:48:30 +0800 CST

Windows EAP/RADIUS 连接问题故障排除

  • 5

所以,我想这个问题的简短版本是:

在设置“新”NPS 服务器和新 CA 后,我无法让客户端连接到企业 WPA 无线网络。在我从 NPS/CA 服务器手动请求我的客户端上的新证书并尝试连接到无线网络后,他们在“尝试进行身份验证”/“等待网络准备就绪”大约一分钟后放弃并说他们无法连接。

我的 NPS/CA 服务器上的日志给出了 23 的 IAS4142“原因代码”...这在关于各种错误代码含义的技术文档中是不存在的。>:/ 发生了什么事,有人知道如何解决吗?或者从哪里开始解决这个问题?(谷歌一直没有帮助......发现一些人有同样的问题,但没有解决方案。)


较长的版本,希望包含可以帮助别人帮助我的信息是:

几周前,我们举办了一场活动,涉及从总部 (2k3 R2) 的两个“主要”DC 强行夺取 FSMO 角色。结果,他们处于离线状态,并且不会回来。当然,在这样做并解决了眼前的危机之后,我们收到了无线访问不再工作的报告。这是有道理的,当我们回头查看断开连接的前 DC 时,发现一个是我们唯一的 IAS 服务器,另一个是我们环境中唯一的 CA。当然,我们使用 WPA 企业无线加密和颁发给客户端机器帐户的证书,以及身份验证所需的域凭据(懒惰的方式,允许客户端使用他们的登录凭据自动进行身份验证,无需用户交互)。

当时觉得还不错的解决方案是,架起一台新的服务器,由于设备限制,把CA和NPS角色放在上面。我也想把它做成一个 DC,但由于其他限制而无法做到。我所知道和阅读的一切都表明这会很好。我还有一个可笑的假设,即我能够以这种方式正确设置它,而不会遇到以前设置的所有烦恼。而且,不想手动重新输入几百个客户端和几十个策略,我遵循了这篇关于如何迁移 NPS 服务器的technet 文章(以及对不正确的 IAS 到 NPS EAP 参数的修复。主要是。而不是 0,16,515在那个部分,我有 0,15,521...所以我按照指示更正了“0”并继续前进。)

我更改了一些 CA 加密设置(SHA-1 到 SHA-512,由于这些天 SHA-1 不安全,以不太迟钝的方式命名根证书等),在 AD 中注册了 NPS,并认为我是很好去。然后我遇到了XP 无法使用 SHA-2 证书进行 AAA的问题(&%#^!!!),当我们的客户仍在使用 XP 时,这是有问题的。应用了该修补程序(其中提到更新将包含在 XP SP4 中...:/),但仍然没有任何乐趣。发现错误代码比我想承认的要多一些(尤其是当我后来注意到安全事件日志中的错误时,所以我浪费了时间来破译****的 IAS 日志),然后去了谷歌寻求帮助,几乎完全空了。其他人也报告了同样的问题,但似乎没有人知道出了什么问题,或者如何解决。事件日志文本:

Log Name:      Security
Source:        Microsoft-Windows-Security-Auditing
Date:          7/16/2012 11:25:37 AM
Event ID:      6273
Task Category: Network Policy Server
Level:         Information
Keywords:      Audit Failure
User:          N/A
Computer:      [The NPS/CA server]
Description:
Network Policy Server denied access to a user.

Contact the Network Policy Server administrator for more information.

User:
    Security ID:            [domain\username]
    Account Name:           [domain\username]
    Account Domain:         [domain]
    Fully Qualified Account Name:   [domain\username]

Client Machine:
    Security ID:            NULL SID
    Account Name:           -
    Fully Qualified Account Name:   -
    OS-Version:         -
    Called Station Identifier:      003a.9a18.7671
    Calling Station Identifier:     0013.e888.ecef

NAS:
    NAS IPv4 Address:       [AP's IP]
    NAS IPv6 Address:       -
    NAS Identifier:         [AP's name]
    NAS Port-Type:          Wireless - IEEE 802.11
    NAS Port:           1939

RADIUS Client:
    Client Friendly Name:       [AP's name]
    Client IP Address:          [AP's IP]

Authentication Details:
    Connection Request Policy Name: [Wifi access policy name]
    Network Policy Name:        [Wifi access policy name]
    Authentication Provider:        Windows
    Authentication Server:      [The NPS/CA server.domain.tld]
    Authentication Type:        PEAP
    EAP Type:           -
    Account Session Identifier:     -
    Logging Results:            Accounting information was written to the local log file.
    Reason Code:            23
    Reason:             An error occurred during the Network Policy Server use of the Extensible Authentication Protocol (EAP). Check EAP log files for EAP errors.

而且,实际上,当我浏览日志以获取该错误时,我注意到它之前的这个错误(相同的时间戳,但在 EventLog 中的另一个之前)...不确定这意味着什么...我的根证书不好?!?!?

Log Name:      Security
Source:        Microsoft-Windows-Security-Auditing
Date:          7/16/2012 11:25:37 AM
Event ID:      5061
Task Category: System Integrity
Level:         Information
Keywords:      Audit Failure
User:          N/A
Computer:      [The NPS/CA server]
Description:
Cryptographic operation.

Subject:
    Security ID:        SYSTEM
    Account Name:       [The NPS/CA server]
    Account Domain:     [domain]
    Logon ID:       0x3e7

Cryptographic Parameters:
    Provider Name:  Microsoft Software Key Storage Provider
    Algorithm Name: RSA
    Key Name:   [Root cert created when the CA was installed]
    Key Type:   Machine key.

Cryptographic Operation:
    Operation:  Decrypt.
    Return Code:    0x80090010

在我做一些激烈的事情之前,[哭泣]比如重新安装我们的 CA 和 NPS 服务器,然后手动配置它......或者买一堆弹药然后开车去 Remdond [/cry] 有没有人有任何关于减轻痛苦的措施的想法可能有助于解决我的问题?

windows-xp troubleshooting radius windows-server-2008-r2 eap
  • 3 个回答
  • 32943 Views
Martin Hope
mgorven
Asked: 2012-06-09 15:28:07 +0800 CST

Auth-Type :- RADIUS 用户文件中的拒绝匹配内部隧道请求但发送 Access-Accept

  • 3

我在 Ubuntu 10.04.4 上使用 FreeRADIUS 2.1.8 与 OpenLDAP 进行了 WPA2 802.11x EAP 身份验证设置,并且可以使用 PEAP/MSCHAPv2、TTLS/MSCHAPv2 和 TTLS/PAP(均通过 AP 和使用eapol_test)成功进行身份验证。我现在正在尝试根据用户所属的 LDAP 组限制对特定 SSID 的访问。

我已经/etc/freeradius/modules/ldap像这样配置了组成员身份检查:

groupname_attribute = cn
groupmembership_filter = "(|(&(objectClass=posixGroup)(memberUid=%{User-Name}))(&(objectClass=posixGroup)(uniquemember=%{User-Name})))"

并且我已经根据Mac Auth wiki 页面配置了将 SSID 从 Called-Station-Id 提取到 Called-Station-SSID 中。我启用了将属性从外部隧道复制到内部隧道,并在/etc/freeradius/eap.conf外部隧道中使用内部隧道响应(对于 PEAP 和 TTLS)。但是,在更改这些选项之前,我有相同的行为。

copy_request_to_tunnel = yes
use_tunneled_reply = yes

我eapol_test像这样运行来测试设置:

eapol_test -c peap-mschapv2.conf -a 172.16.0.16 -s testing123 -N 30:s:01-23-45-67-89-01:Example-EAP

使用以下peap-mschapv2.conf文件:

network={
    ssid="Example-EAP"
    key_mgmt=WPA-EAP
    eap=PEAP
    identity="mgorven"
    anonymous_identity="anonymous"
    password="foobar"
    phase2="autheap=MSCHAPV2"
}

在以下内容中/etc/freeradius/users:

DEFAULT Ldap-Group == "employees"

并运行freeradius-Xx,我可以看到 LDAP 组检索有效,并且提取了 SSID。

Debug:   [ldap] performing search in dc=example,dc=com, with filter (&(cn=employees)(|(&(objectClass=posixGroup)(memberUid=mgorven))(&(objectClass=posixGroup)(uniquemember=mgorven))))
Debug: rlm_ldap::ldap_groupcmp: User found in group employees
...
Info:        expand: %{7} -> Example-EAP

接下来我尝试只允许employees组中的用户访问(不管 SSID 是什么),所以我将以下内容放入/etc/freeradius/users:

DEFAULT Ldap-Group == "employees"

DEFAULT Auth-Type := Reject

但这会立即拒绝外部隧道中的访问请求,因为anonymous用户不在employees组中。所以我将其修改为仅匹配内部隧道请求,如下所示:

DEFAULT Ldap-Group == "employees"

DEFAULT FreeRADIUS-Proxied-To == "127.0.0.1"
        Auth-Type := Reject, Reply-Message = "User does not belong to any groups which may access this SSID."

现在组中的用户已employees通过身份验证,但不在employees组中的用户也已通过身份验证。我看到拒绝条目被匹配,并且设置了回复消息,但客户端收到了一个访问接受。

Debug: rlm_ldap::ldap_groupcmp: Group employees not found or user is not a member.
Info: [files] users: Matched entry DEFAULT at line 209
Info: ++[files] returns ok
...
Auth: Login OK: [mgorven] (from client test port 0 cli 02-00-00-00-00-01 via TLS tunnel)
Info:   WARNING: Empty section.  Using default return values.
...
Info: [peap] Got tunneled reply code 2
        Auth-Type := Reject
        Reply-Message = "User does not belong to any groups which may access this SSID."
...
Info: [peap] Got tunneled reply RADIUS code 2
        Auth-Type := Reject
        Reply-Message = "User does not belong to any groups which may access this SSID."
...
Info: [peap] Tunneled authentication was successful.
Info: [peap] SUCCESS
Info: [peap] Saving tunneled attributes for later
...
Sending Access-Accept of id 11 to 172.16.2.44 port 60746
        Reply-Message = "User does not belong to any groups which may access this SSID."
        User-Name = "mgorven"

和eapol_test报告:

RADIUS message: code=2 (Access-Accept) identifier=11 length=233
   Attribute 18 (Reply-Message) length=64
      Value: 'User does not belong to any groups which may access this SSID.'
   Attribute 1 (User-Name) length=9
      Value: 'mgorven'
...
SUCCESS

为什么请求没有被拒绝,这是实现它的正确方法吗?

ldap wpa2 radius freeradius eap
  • 1 个回答
  • 5305 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve